﻿/* ═══════════════════════════════════════════════════════════
   Star20 — Register Wizard
   Two-pane card · Stepper · OTP · Smooth transitions
   ═══════════════════════════════════════════════════════════ */

/* ── Page wrapper ── */
.auth-wizard-page {
    min-height: calc(100vh - var(--header-h) - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    background: radial-gradient(700px 480px at 85% 10%, rgba(109,40,217,.10), transparent 60%), radial-gradient(600px 420px at 15% 90%, rgba(245,158,11,.08), transparent 60%);
}

/* ── Grid ── */
.auth-wizard {
    width: 100%;
    max-width: 1000px;
    display: grid;
    grid-template-columns: 380px 1fr;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(30,27,75,.04), 0 30px 70px -30px rgba(109,40,217,.28);
}

/* ═══════════════════════════════════════════
   Aside — Purple brand panel
   ═══════════════════════════════════════════ */
.auth-wizard-aside {
    position: relative;
    padding: 2.4rem 1.9rem;
    color: #fff;
    background: radial-gradient(500px 400px at 80% 0%, rgba(255,255,255,.12), transparent 60%), radial-gradient(400px 350px at 10% 100%, rgba(245,158,11,.18), transparent 60%), linear-gradient(160deg, #4C1D95 0%, #312E81 55%, #1E1B4B 100%);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    overflow: hidden;
}

    .auth-wizard-aside::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,.06) 0, transparent 2px), radial-gradient(circle at 70% 60%, rgba(255,255,255,.05) 0, transparent 2px);
        background-size: 140px 140px, 180px 180px;
        opacity: .6;
        pointer-events: none;
    }

.auth-aside-brand {
    display: inline-flex;
    align-items: center;
    height: 46px;
    padding: 4px 10px;
    background: #7aff79;
    border-radius: 10px;
    box-shadow: 4px 6px 18px -6px rgb(34 211 160 / .55);
    align-self: flex-start;
    position: relative;
    z-index: 1;
}

    .auth-aside-brand img {
        width: 96px;
        height: auto;
        display: block;
    }

.auth-aside-title {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.4;
    margin: .5rem 0 0;
    letter-spacing: -.01em;
    position: relative;
    z-index: 1;
}

.auth-aside-text {
    color: rgba(255,255,255,.72);
    font-size: .88rem;
    line-height: 1.9;
    margin: 0;
    position: relative;
    z-index: 1;
}

.auth-aside-features {
    list-style: none;
    padding: 0;
    margin: .6rem 0 0;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    position: relative;
    z-index: 1;
}

    .auth-aside-features li {
        display: flex;
        align-items: center;
        gap: .6rem;
        font-size: .84rem;
        font-weight: 500;
        color: rgba(255,255,255,.88);
    }

        .auth-aside-features li i {
            color: #FBBF24;
            font-size: 1rem;
            flex: 0 0 auto;
        }

.auth-aside-trust {
    margin-top: auto;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255,255,255,.12);
    display: flex;
    align-items: center;
    gap: .55rem;
    color: rgba(255,255,255,.72);
    font-size: .78rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

    .auth-aside-trust i {
        color: #A5B4FC;
        font-size: 1.05rem;
    }

/* ═══════════════════════════════════════════
   Main — Form panel
   ═══════════════════════════════════════════ */
.auth-wizard-main {
    padding: 2rem 2.1rem 1.6rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── Stepper ── */
.auth-stepper {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px dashed var(--line);
}

.auth-step {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    opacity: .5;
    transition: opacity .25s ease;
}

.auth-step-num {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
    line-height: 1;
    transition: background .25s, color .25s, box-shadow .25s, transform .25s;
}

.auth-step-label {
    font-size: .82rem;
    font-weight: 700;
    color: var(--muted);
    transition: color .25s;
    white-space: nowrap;
}

.auth-step.is-active,
.auth-step.is-done {
    opacity: 1;
}

    .auth-step.is-active .auth-step-num {
        background: linear-gradient(135deg, var(--primary), var(--primary-600));
        color: #fff;
        box-shadow: 0 6px 16px -6px rgba(109,40,217,.55);
        transform: scale(1.05);
    }

    .auth-step.is-active .auth-step-label {
        color: var(--primary-700);
    }

    .auth-step.is-done .auth-step-num {
        background: var(--primary-soft);
        color: var(--primary);
    }

    .auth-step.is-done .auth-step-label {
        color: var(--primary-700);
    }

.auth-step-line {
    flex: 1;
    height: 2px;
    background: var(--line);
    border-radius: 999px;
    position: relative;
    overflow: hidden;
}

    .auth-step-line::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, var(--primary), var(--primary-600));
        transform: translateX(100%);
        transition: transform .4s ease;
    }

.auth-stepper.step-2 .auth-step-line::after {
    transform: translateX(0);
}

/* ── Panes ── */
.auth-pane {
    display: none;
    flex-direction: column;
    gap: .85rem;
    flex: 1;
}

    .auth-pane.is-active {
        display: flex;
        animation: pane-in .32s ease-out;
    }

@keyframes pane-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-pane-head {
    margin-bottom: .3rem;
}

    .auth-pane-head h1 {
        font-size: 1.3rem;
        font-weight: 800;
        margin: 0 0 .35rem;
        color: var(--ink);
        letter-spacing: -.01em;
    }

    .auth-pane-head p {
        color: var(--muted);
        font-size: .84rem;
        margin: 0;
        line-height: 1.8;
    }

/* ── Back link ── */
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .6rem .3rem .3rem;
    margin: 0 0 .6rem -.2rem;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: .76rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    transition: background .15s, color .15s;
}

    .auth-back:hover {
        background: var(--primary-soft);
        color: var(--primary-700);
    }

    .auth-back i {
        font-size: .95rem;
    }

/* ── Fields ── */
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.field-with-action {
    position: relative;
    display: flex;
    align-items: center;
}

    .field-with-action .form-control {
        padding-left: 2.6rem;
    }

.field-action {
    position: absolute;
    left: .55rem;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted-2);
    font-size: .95rem;
    cursor: pointer;
    transition: background .15s, color .15s;
    -webkit-tap-highlight-color: transparent;
}

    .field-action:hover {
        background: var(--primary-soft);
        color: var(--primary);
    }

/* ── Summary chips (step 2) ── */
.auth-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .55rem;
    padding: .65rem;
    background: var(--primary-soft);
    border: 1px solid var(--primary-line);
    border-radius: 14px;
    margin-bottom: .4rem;
}

.auth-summary-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .5rem .65rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    min-width: 0;
}

.auth-summary-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: .95rem;
    flex: 0 0 auto;
}

.auth-summary-text {
    min-width: 0;
    overflow: hidden;
}

    .auth-summary-text small {
        display: block;
        color: var(--muted);
        font-size: .66rem;
        font-weight: 600;
        line-height: 1.2;
    }

    .auth-summary-text strong {
        display: block;
        color: var(--ink);
        font-size: .78rem;
        font-weight: 700;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* ── OTP ── */
.auth-otp {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: .35rem;
}

.otp-inputs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: .5rem;
    direction: ltr;
    justify-items: stretch;
}

.otp-input {
    width: 100%;
    aspect-ratio: 1 / 1.15;
    max-height: 62px;
    padding: 0;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #FBFBFA;
    color: var(--ink);
    font-family: inherit;
    font-size: 1.4rem;
    font-weight: 800;
    text-align: center;
    line-height: 1;
    outline: 0;
    transition: border-color .18s, background .18s, box-shadow .18s, transform .18s;
    -webkit-tap-highlight-color: transparent;
    caret-color: var(--primary);
}

    .otp-input:hover {
        border-color: var(--primary-line);
        background: #fff;
    }

    .otp-input:focus {
        border-color: var(--primary);
        background: #fff;
        box-shadow: 0 0 0 3px rgba(109,40,217,.14);
        transform: translateY(-1px);
    }

    .otp-input:not(:placeholder-shown),
    .otp-input:valid:not(:placeholder-shown) {
        /* filled state handled via JS class */
    }

    .otp-input.is-filled {
        border-color: var(--primary);
        background: var(--primary-soft);
        color: var(--primary-700);
    }

    .otp-input[readonly] {
        cursor: default;
        background: var(--success-soft);
        border-color: #A7F3D0;
        color: #065F46;
    }

/* ── Resend ── */
.auth-resend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .55rem .2rem 0;
    color: var(--muted);
    font-size: .8rem;
}

.auth-resend-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .35rem .7rem;
    border: 1px solid var(--primary-line);
    border-radius: 8px;
    background: #fff;
    color: var(--primary-700);
    font-family: inherit;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

    .auth-resend-btn:hover:not(:disabled) {
        background: var(--primary-soft);
        color: var(--primary);
    }

    .auth-resend-btn:disabled {
        cursor: not-allowed;
        opacity: .55;
        background: var(--surface-2);
        border-color: var(--line);
        color: var(--muted-2);
    }

    .auth-resend-btn i {
        font-size: .9rem;
    }

.auth-countdown {
    font-variant-numeric: tabular-nums;
    color: var(--muted-2);
    font-weight: 700;
}

/* ── Alerts / messages ── */
.auth-alert {
    min-height: 0;
    padding: 0;
    border-radius: 10px;
    font-size: .8rem;
    line-height: 1.7;
    transition: padding .15s, background .15s;
    text-align: center;
}

    .auth-alert.is-error {
        padding: .55rem .8rem;
        background: var(--danger-soft);
        color: #9F1239;
        border: 1px solid #FECDD3;
    }

    .auth-alert.is-success {
        padding: .55rem .8rem;
        background: var(--success-soft);
        color: #065F46;
        border: 1px solid #A7F3D0;
    }

/* ── CTA ── */
.auth-cta {
    width: 100%;
    padding: .85rem 1rem;
    border-radius: 12px;
    font-size: .92rem;
    font-weight: 800;
    margin-top: .5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

    .auth-cta:disabled {
        opacity: .55;
        cursor: not-allowed;
        box-shadow: none;
        background: var(--surface-2);
        color: var(--muted-2);
        border: 1px solid var(--line);
    }

    .auth-cta.is-ready {
        animation: cta-ready .5s ease-out;
    }

@keyframes cta-ready {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.025);
    }

    100% {
        transform: scale(1);
    }
}

/* ── Auth switch (login link) ── */
.auth-switch {
    margin-top: auto;
    padding-top: 1.2rem;
    border-top: 1px dashed var(--line);
    color: var(--muted);
    font-size: .82rem;
    text-align: center;
}

    .auth-switch a {
        font-weight: 800;
        color: var(--primary);
        margin-right: .15rem;
    }

/* ── Validation tweaks (integrate with site.css) ── */
.auth-pane .validation-summary {
    margin-bottom: .5rem;
}

.auth-pane .field-error {
    min-height: 0;
}

    .auth-pane .field-error:empty {
        margin-top: 0;
    }

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */
@media (max-width: 900px) {
    .auth-wizard {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .auth-wizard-aside {
        padding: 1.4rem 1.5rem;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        text-align: right;
    }

    .auth-aside-brand {
        height: 40px;
        padding: 3px 8px;
    }

        .auth-aside-brand img {
            width: 82px;
        }

    .auth-aside-title {
        font-size: 1rem;
        margin: 0;
        flex: 1;
    }

    .auth-aside-text,
    .auth-aside-features,
    .auth-aside-trust {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .auth-wizard-page {
        padding: 1.2rem .75rem;
        align-items: flex-start;
    }

    .auth-wizard {
        border-radius: 20px;
    }

    .auth-wizard-aside {
        padding: 1.1rem 1.2rem;
    }

    .auth-aside-title {
        font-size: .95rem;
    }

    .auth-wizard-main {
        padding: 1.4rem 1.15rem 1.2rem;
    }

    .auth-stepper {
        gap: .4rem;
        margin-bottom: 1.15rem;
        padding-bottom: .95rem;
    }

    .auth-step-label {
        font-size: .72rem;
    }

    .auth-step-num {
        width: 26px;
        height: 26px;
        font-size: .72rem;
    }

    .auth-pane-head h1 {
        font-size: 1.12rem;
    }

    .auth-pane-head p {
        font-size: .78rem;
    }

    .auth-summary {
        grid-template-columns: 1fr;
        padding: .5rem;
        gap: .4rem;
    }

    .auth-summary-item {
        padding: .45rem .55rem;
    }

    .otp-inputs {
        gap: .35rem;
    }

    .otp-input {
        max-height: 52px;
        font-size: 1.15rem;
        border-radius: 10px;
    }
}

.auth-resend[hidden] {
    display: none !important;
}

.auth-resend {
    transition: opacity .2s ease;
}

@media (max-width: 380px) {
    .otp-input {
        max-height: 46px;
        font-size: 1rem;
        border-radius: 9px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .auth-pane.is-active,
    .auth-cta.is-ready {
        animation: none;
    }

    .auth-step-num,
    .auth-step-line::after,
    .otp-input {
        transition: none;
    }
}
