/* ══════════════════════════════════════════
   Elite Creed — Forms
   ══════════════════════════════════════════ */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--fs-small);
    font-weight: var(--fw-medium);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-family: var(--font-body);
    font-size: var(--fs-body);
    border: 1.5px solid var(--color-border-soft);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--color-text-primary);
    transition: border-color var(--duration-fast), box-shadow var(--duration-fast), background var(--duration-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
    background: var(--bg-input-focus);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-muted);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.08);
}

.form-error-text {
    font-size: var(--fs-xs);
    color: var(--color-danger);
    margin-top: var(--space-1);
}

.form-hint {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23B0B0B0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-select option,
select.form-input option {
    background: var(--color-surface-700);
    color: var(--color-text-primary);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    transition: background var(--duration-fast);
}
.form-check:hover {
    background: rgba(255,255,255,0.02);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary);
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
}

.form-check__label {
    font-size: var(--fs-small);
    color: var(--color-text-secondary);
    cursor: pointer;
    line-height: 1.5;
}

/* Toggle card (for legal checkboxes) */
.toggle-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border: 1.5px solid var(--color-border-soft);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration-normal);
    background: var(--bg-card);
}
.toggle-card:hover {
    border-color: var(--color-border-medium);
    background: var(--bg-card-hover);
}
.toggle-card.is-checked {
    border-color: var(--color-primary);
    background: var(--color-primary-dim);
}
.toggle-card input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--color-primary);
    flex-shrink: 0;
    margin-top: 2px;
}
.toggle-card__text {
    font-size: var(--fs-small);
    color: var(--color-text-secondary);
    line-height: 1.5;
}
.toggle-card.is-checked .toggle-card__text {
    color: var(--color-text-primary);
}

/* Form Row (side-by-side) */
.form-row {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 1fr;
}
@media (min-width: 576px) {
    .form-row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 992px) {
    .form-row--3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* Multi-step Form */
.form-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-8);
}
.form-step-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.form-step-dot {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-border-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    color: var(--color-text-muted);
    transition: all var(--duration-normal);
}
.form-step-dot.is-active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-bg-900);
}
.form-step-dot.is-completed {
    border-color: var(--color-success);
    background: var(--color-success-bg);
    color: var(--color-success);
}
.form-step-line {
    width: 40px;
    height: 2px;
    background: var(--color-border-soft);
}
.form-step-line.is-completed {
    background: var(--color-success);
}
.form-step-label {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    display: none;
}
@media (min-width: 768px) {
    .form-step-label { display: block; }
}

.form-panel {
    display: none;
}
.form-panel.is-active {
    display: block;
    animation: fadeSlideUp 0.3s var(--ease-out);
}

/* Password Peek Toggle */
.password-wrapper {
    position: relative;
    width: 100%;
}
.password-wrapper .form-input {
    padding-right: 3rem;
}
.password-peek {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted, #B0B0B0);
    padding: 0;
    z-index: 2;
    transition: color var(--duration-fast, 150ms);
}
.password-peek svg {
    flex-shrink: 0;
}
.password-peek:hover {
    color: var(--color-primary, #FFD700);
}
.password-peek:focus {
    outline: none;
    color: var(--color-primary, #FFD700);
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--color-border-medium);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    text-align: center;
    cursor: pointer;
    transition: all var(--duration-normal);
    background: var(--bg-card);
}
.file-upload:hover,
.file-upload.is-dragover {
    border-color: var(--color-primary);
    background: var(--color-primary-dim);
}
.file-upload__icon {
    font-size: 2.5rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}
.file-upload__text {
    font-size: var(--fs-small);
    color: var(--color-text-muted);
}
.file-upload__text strong {
    color: var(--color-primary);
}
.file-upload input[type="file"] {
    display: none;
}

/* Upload Progress */
.upload-progress {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-soft);
    margin-top: var(--space-2);
}
.upload-progress__info {
    flex: 1;
}
.upload-progress__name {
    font-size: var(--fs-small);
    font-weight: var(--fw-medium);
    color: var(--color-text-primary);
}
.upload-progress__size {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
}

/* Auth Form Layout */
.auth-page {
    min-height: 100vh;
    display: flex;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    isolation: isolate;
    background:
        radial-gradient(circle at top left, rgba(255, 215, 0, 0.08), transparent 28%),
        radial-gradient(circle at bottom right, rgba(94, 234, 212, 0.06), transparent 24%),
        linear-gradient(135deg, #081321 0%, #0d1b2e 45%, #132240 100%);
}
.auth-page::before,
.auth-page::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.auth-page::before {
    background:
        radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.9) 0 0.9px, transparent 1.7px) 0 0 / 220px 220px,
        radial-gradient(circle at 72% 36%, rgba(255, 215, 0, 0.95) 0 1.1px, transparent 2px) 0 0 / 300px 300px,
        radial-gradient(circle at 36% 78%, rgba(255, 255, 255, 0.45) 0 0.8px, transparent 1.5px) 0 0 / 180px 180px;
    opacity: 0.28;
    animation: auth-stars-drift 96s linear infinite;
}
.auth-page::after {
    inset: -12%;
    background:
        radial-gradient(circle, rgba(255, 215, 0, 0.22) 0 1px, transparent 2.5px) 0 0 / 180px 180px,
        radial-gradient(circle, rgba(255, 165, 0, 0.16) 0 1.2px, transparent 2.8px) 32px 68px / 240px 240px,
        radial-gradient(circle, rgba(255, 255, 255, 0.12) 0 0.9px, transparent 2px) 20px 38px / 200px 200px;
    opacity: 0.58;
    filter: blur(0.35px);
    animation: auth-gold-dust 24s linear infinite alternate;
}
.auth-page > :not(.auth-scene) {
    position: relative;
    z-index: 1;
}
.auth-scene {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.auth-scene__car,
.auth-scene__coin,
.auth-scene__money,
.auth-scene__loan {
    position: absolute;
    color: var(--color-primary);
    fill: none;
    stroke: currentColor;
    filter: blur(0.3px);
    mix-blend-mode: screen;
}
.auth-scene__car text,
.auth-scene__coin text,
.auth-scene__money text,
.auth-scene__loan text {
    fill: currentColor;
    stroke: none;
}
.auth-scene__car {
    opacity: 0.2;
}
.auth-scene__car--sedan {
    width: min(44vw, 520px);
    left: -5%;
    bottom: 4%;
    animation: auth-car-drift 30s ease-in-out infinite;
}
.auth-scene__car--suv {
    width: min(34vw, 420px);
    right: -4%;
    top: 12%;
    opacity: 0.16;
    animation: auth-car-drift 34s ease-in-out infinite reverse;
}
.auth-scene__car--coupe {
    width: min(30vw, 360px);
    left: 28%;
    top: 18%;
    opacity: 0.13;
    animation: auth-car-drift 26s ease-in-out infinite;
}
.auth-scene__coin {
    opacity: 0.12;
    animation: auth-coin-float 22s ease-in-out infinite;
}
.auth-scene__coin--one {
    width: 64px;
    top: 24%;
    left: 8%;
}
.auth-scene__coin--two {
    width: 48px;
    right: 16%;
    bottom: 18%;
    animation-delay: 6s;
}
.auth-scene__money {
    opacity: 0.14;
    animation: auth-float-soft 28s ease-in-out infinite;
}
.auth-scene__money--stack {
    width: min(18vw, 200px);
    right: 10%;
    top: 34%;
}
.auth-scene__loan {
    opacity: 0.12;
    animation: auth-float-soft 24s ease-in-out infinite reverse;
}
.auth-scene__loan--sheet {
    width: min(15vw, 160px);
    left: 10%;
    top: 52%;
}
.auth-scene__dust {
    position: absolute;
    border-radius: 999px;
    background:
        radial-gradient(circle at center, rgba(255, 215, 0, 0.3), transparent 68%);
    filter: blur(34px);
    opacity: 1;
    mix-blend-mode: screen;
    animation: auth-dust-cloud 18s ease-in-out infinite;
}
.auth-scene__dust--one {
    width: 240px;
    height: 240px;
    top: 8%;
    right: 10%;
}
.auth-scene__dust--two {
    width: 320px;
    height: 320px;
    left: -4%;
    bottom: 10%;
    animation-delay: 4s;
}
.auth-scene__dust--three {
    width: 180px;
    height: 180px;
    top: 48%;
    right: 24%;
    animation-delay: 8s;
}
.auth-brand {
    display: none;
    flex: 1;
    background:
        linear-gradient(135deg, rgba(11, 25, 41, 0.34) 0%, rgba(19, 34, 64, 0.18) 100%);
    padding: var(--space-12);
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
@media (min-width: 992px) {
    .auth-brand { display: flex; }
}
.auth-brand::before,
.auth-brand::after,
.auth-form-wrap::before,
.auth-form-wrap::after {
    content: '';
    position: absolute;
    pointer-events: none;
}
.auth-brand::before {
    inset: 10% auto auto 6%;
    width: min(28vw, 360px);
    height: min(28vw, 360px);
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 215, 0, 0.22), transparent 42%),
        radial-gradient(circle at 65% 60%, rgba(255, 255, 255, 0.08), transparent 48%);
    filter: blur(6px);
    opacity: 0.9;
    animation: auth-orb-float 16s ease-in-out infinite;
}
.auth-brand::after {
    right: -8%;
    bottom: -12%;
    width: min(34vw, 420px);
    height: min(34vw, 420px);
    border-radius: 50%;
    background:
        radial-gradient(circle at 48% 48%, rgba(255, 165, 0, 0.18), transparent 44%),
        radial-gradient(circle at 30% 34%, rgba(255, 215, 0, 0.12), transparent 30%);
    filter: blur(10px);
    opacity: 0.75;
    animation: auth-orb-float 20s ease-in-out infinite reverse;
}
.auth-brand__content {
    max-width: 400px;
    text-align: center;
    position: relative;
    padding: clamp(1.75rem, 2vw, 2.4rem);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)),
        rgba(11, 25, 41, 0.14);
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
}
.auth-brand__content::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 215, 0, 0.1), transparent 34%),
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.16), transparent 24%),
        radial-gradient(circle at 82% 78%, rgba(255, 215, 0, 0.08), transparent 26%);
    opacity: 0.9;
    pointer-events: none;
}
.auth-brand__logo {
    margin-bottom: var(--space-4);
    position: relative;
}
.auth-brand__logo-img {
    height: 80px;
    width: auto;
    object-fit: contain;
}
.auth-brand__tagline {
    font-size: var(--fs-h4);
    color: var(--color-text-secondary);
    line-height: var(--leading-normal);
    position: relative;
    max-width: 22rem;
    margin: 0 auto;
}

.auth-form-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    background:
        radial-gradient(circle at 10% 18%, rgba(255, 215, 0, 0.12), transparent 24%),
        radial-gradient(circle at 86% 12%, rgba(255, 255, 255, 0.08), transparent 22%),
        radial-gradient(circle at 50% 100%, rgba(94, 234, 212, 0.06), transparent 22%),
        rgba(8, 19, 33, 0.08);
    position: relative;
    overflow: hidden;
}
.auth-form-wrap::before {
    top: 8%;
    left: 10%;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.12), transparent 62%);
    filter: blur(8px);
    opacity: 0.8;
    animation: auth-orb-float 18s ease-in-out infinite;
}
.auth-form-wrap::after {
    right: 8%;
    bottom: 6%;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 165, 0, 0.08), transparent 64%);
    filter: blur(10px);
    opacity: 0.7;
    animation: auth-orb-float 22s ease-in-out infinite reverse;
}
.auth-form {
    width: 100%;
    max-width: 420px;
    position: relative;
    padding: clamp(1.4rem, 2.5vw, 2.2rem);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
        rgba(11, 25, 41, 0.44);
    border: 1px solid rgba(255, 215, 0, 0.22);
    box-shadow: 0 22px 64px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
}
.auth-form::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(145deg, rgba(255, 215, 0, 0.08), transparent 34%),
        radial-gradient(circle at 80% 18%, rgba(255, 255, 255, 0.12), transparent 20%),
        radial-gradient(circle at 14% 86%, rgba(255, 215, 0, 0.06), transparent 24%);
    pointer-events: none;
}
.auth-form > * {
    position: relative;
    z-index: 1;
}
.auth-form__title {
    font-size: var(--fs-h2);
    font-weight: var(--fw-bold);
    margin-bottom: var(--space-2);
}
.auth-form__subtitle {
    font-size: var(--fs-body);
    color: var(--color-text-muted);
    margin-bottom: var(--space-8);
}
.auth-form__footer {
    text-align: center;
    margin-top: var(--space-6);
    font-size: var(--fs-small);
    color: var(--color-text-muted);
}
.auth-form__footer a {
    color: var(--color-primary);
    font-weight: var(--fw-medium);
}

/* Auth Role Cards (Login/Register Chooser) */
.auth-role-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.auth-role-card {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-5) var(--space-6);
    border: 1.5px solid var(--color-border-soft);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    text-decoration: none;
    transition: all var(--duration-normal);
    cursor: pointer;
}
.auth-role-card:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-dim);
    transform: translateY(-1px);
}
.auth-role-card__icon {
    font-size: 1.75rem;
    color: var(--color-primary);
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--color-primary-dim);
}
.auth-role-card__body {
    flex: 1;
    min-width: 0;
}
.auth-role-card__title {
    font-size: var(--fs-body);
    font-weight: var(--fw-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}
.auth-role-card__desc {
    font-size: var(--fs-small);
    color: var(--color-text-muted);
}

@keyframes auth-stars-drift {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(-110px, 72px, 0);
    }
}

@keyframes auth-gold-dust {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(18px, -12px, 0) scale(1.03);
    }
    100% {
        transform: translate3d(-18px, 14px, 0) scale(0.98);
    }
}

@keyframes auth-orb-float {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(14px, -18px, 0);
    }
}

@keyframes auth-car-drift {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(18px, -14px, 0);
    }
}

@keyframes auth-coin-float {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(0, -16px, 0);
    }
}

@keyframes auth-float-soft {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(10px, -12px, 0);
    }
}

@keyframes auth-dust-cloud {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(14px, -10px, 0) scale(1.06);
    }
}

@media (max-width: 991.98px) {
    .auth-scene__car--sedan {
        width: min(84vw, 460px);
        left: -18%;
        bottom: 2%;
        opacity: 0.24;
    }

    .auth-scene__car--suv {
        width: min(64vw, 360px);
        right: -12%;
        top: 6%;
        opacity: 0.18;
    }

    .auth-scene__car--coupe {
        width: min(58vw, 320px);
        left: 22%;
        top: 20%;
        opacity: 0.14;
    }

    .auth-scene__coin--one {
        top: 16%;
        left: auto;
        right: 12%;
    }

    .auth-scene__coin--two {
        left: 10%;
        right: auto;
        bottom: 16%;
    }

    .auth-scene__money--stack {
        width: min(32vw, 150px);
        right: 4%;
        top: 42%;
        opacity: 0.16;
    }

    .auth-scene__loan--sheet {
        width: min(24vw, 110px);
        left: 4%;
        top: 58%;
        opacity: 0.14;
    }

    .auth-form-wrap {
        background:
            radial-gradient(circle at 14% 12%, rgba(255, 215, 0, 0.12), transparent 22%),
            radial-gradient(circle at 86% 14%, rgba(255, 255, 255, 0.08), transparent 18%),
            rgba(8, 19, 33, 0.04);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page::before,
    .auth-page::after,
    .auth-scene__car,
    .auth-scene__coin,
    .auth-scene__dust,
    .auth-brand::before,
    .auth-brand::after,
    .auth-form-wrap::before,
    .auth-form-wrap::after {
        animation: none !important;
    }
}
