/* Optimal Markets — Auth / Onboarding shell */

.auth-body {
    min-height: 100vh;
    margin: 0;
    font-family: var(--font);
    color: var(--text-2);
    background: var(--canvas, #F8FAFC);
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    min-height: 100vh;
}

/* ── Form column ─────────────────────────────────────────── */
.auth-form-col {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 50% at 0% 0%, rgba(37, 99, 235, 0.07), transparent 55%),
        linear-gradient(180deg, #F8FAFC 0%, #EFF6FF 42%, #F8FAFC 100%);
}

.auth-form-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 28px 0;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}
.auth-brand:hover { color: var(--text); }
.auth-brand__mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(145deg, var(--brand-600), var(--brand-800));
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 14px;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}
.auth-phase {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.auth-progress {
    height: 3px;
    margin: 18px 28px 0;
    background: var(--border);
    border-radius: var(--r-full);
    overflow: hidden;
}
.auth-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-600), #60A5FA);
    border-radius: var(--r-full);
    transition: width 0.3s ease;
}

.auth-form-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 24px 40px;
}

.auth-form-wrap {
    width: 100%;
    max-width: 440px;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-600);
    margin-bottom: 10px;
}
.auth-title {
    font-size: clamp(26px, 3.2vw, 32px);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    margin: 0 0 8px;
    line-height: 1.15;
}
.auth-lead {
    font-size: 14.5px;
    color: var(--text-3);
    margin: 0 0 28px;
    line-height: 1.55;
}

.auth-field { margin-bottom: 16px; }
.auth-field__label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
}
.auth-field__control {
    position: relative;
    display: flex;
    align-items: center;
}
.auth-field__icon {
    position: absolute;
    left: 14px;
    color: var(--text-4);
    font-size: 13px;
    pointer-events: none;
    z-index: 1;
}
.auth-input,
.auth-select {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 40px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
    color: var(--text);
    font-size: 14.5px;
    font-family: var(--font);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    appearance: none;
}
.auth-input::placeholder { color: var(--text-4); }
.auth-input:hover,
.auth-select:hover { border-color: var(--border-strong); }
.auth-input:focus,
.auth-select:focus {
    border-color: var(--brand-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.auth-select {
    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='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}
.auth-pw-toggle {
    position: absolute;
    right: 10px;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: var(--text-4);
    cursor: pointer;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
}
.auth-pw-toggle:hover { color: var(--text-2); background: var(--surface-2); }

.auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 20px;
    flex-wrap: wrap;
}
.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
}
.auth-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-600);
    cursor: pointer;
}
.auth-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-600);
    text-decoration: none;
}
.auth-link:hover { color: var(--brand-700); text-decoration: underline; }

.auth-terms {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 8px 0 18px;
    font-size: 13px;
    color: var(--text-3);
    line-height: 1.45;
}
.auth-terms input {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: var(--brand-600);
    flex-shrink: 0;
}
.auth-terms a {
    color: var(--brand-600);
    font-weight: 600;
    text-decoration: none;
}
.auth-terms a:hover { text-decoration: underline; }

.auth-terms-error {
    display: none;
    align-items: center;
    gap: 8px;
    margin: -8px 0 16px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
    font-size: 13px;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: var(--r-lg);
    background: var(--brand-600);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    font-family: var(--font);
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.auth-btn:hover {
    background: var(--brand-700);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.32);
}
.auth-btn:active { transform: translateY(0); }

.auth-btn--ghost {
    margin-top: 10px;
    background: transparent;
    color: var(--text-2);
    border: 1.5px solid var(--border);
    box-shadow: none;
}
.auth-btn--ghost:hover {
    background: var(--surface-2, #F1F5F9);
    color: var(--text);
    box-shadow: none;
    transform: none;
}

.auth-skip-form { margin-top: 4px; }
.auth-skip-hint {
    margin: 10px 0 0;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-3);
}

.auth-optional {
    font-weight: 500;
    color: var(--text-4);
    text-transform: lowercase;
    letter-spacing: 0;
}

.auth-phone {
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-phone:hover { border-color: var(--border-strong); }
.auth-phone:focus-within {
    border-color: var(--brand-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.auth-phone__dial {
    flex-shrink: 0;
    margin-left: 38px;
    padding: 0 10px 0 0;
    min-width: 46px;
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    border-right: 1px solid var(--border);
    line-height: 1;
}
.auth-phone .auth-phone__input {
    border: 0;
    box-shadow: none;
    padding-left: 12px;
    height: 45px;
    background: transparent;
}
.auth-phone .auth-phone__input:hover,
.auth-phone .auth-phone__input:focus {
    border: 0;
    box-shadow: none;
}

.auth-switch {
    text-align: center;
    margin-top: 22px;
    font-size: 14px;
    color: var(--text-3);
}
.auth-switch a {
    color: var(--brand-600);
    font-weight: 700;
    text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

.auth-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
    font-size: 12px;
    color: var(--text-4);
}

.field-error,
.alt-error-message {
    display: block;
    min-height: 0;
    margin-top: 5px;
    font-size: 12.5px;
    color: #DC2626;
}

/* OTP */
.auth-otp {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 8px 0 16px;
    flex-wrap: wrap;
}
.auth-otp .otp-input {
    width: 48px;
    height: 54px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    padding: 0;
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
    color: var(--text);
}
.auth-otp .otp-input:focus {
    border-color: var(--brand-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
    outline: none;
}

/* Password strength */
.auth-pw-meter {
    margin-top: 8px;
}
.auth-pw-meter__bar {
    height: 4px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}
.auth-pw-meter__fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    transition: width .2s ease, background .2s ease;
    background: #94A3B8;
}
.auth-pw-meter__fill.is-weak { width: 25%; background: #EF4444; }
.auth-pw-meter__fill.is-fair { width: 50%; background: #F59E0B; }
.auth-pw-meter__fill.is-good { width: 75%; background: #2563EB; }
.auth-pw-meter__fill.is-strong { width: 100%; background: #059669; }
.auth-pw-meter__label {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
}
.auth-pw-rules {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: grid;
    gap: 4px;
}
.auth-pw-rules li {
    font-size: 12px;
    color: var(--text-4);
    display: flex;
    align-items: center;
    gap: 8px;
}
.auth-pw-rules li i { font-size: 10px; width: 14px; text-align: center; }
.auth-pw-rules li.is-ok { color: #059669; }
.auth-pw-rules li.is-ok i { color: #059669; }

/* Auth busy — single Swal surface (overrides theme nested look) */
.swal2-popup.om-busy-swal {
    width: min(340px, 90vw) !important;
    padding: 28px 24px 24px !important;
    border-radius: 16px !important;
    background: #fff !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18) !important;
}
.om-busy-swal__title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
    letter-spacing: -0.02em !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
}
.om-busy-swal__body {
    margin: 0 !important;
    padding: 0 !important;
}
.om-busy-swal__sub {
    font-size: 13px;
    color: #64748B;
    margin: 0 0 18px;
    line-height: 1.45;
}
.om-busy-swal__ring {
    width: 44px;
    height: 44px;
    margin: 0 auto 8px;
    border-radius: 50%;
    border: 3px solid #DBEAFE;
    border-top-color: #2563EB;
    animation: omSpin .7s linear infinite;
}
.om-busy-swal__dots span {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin: 10px 3px 0;
    border-radius: 50%;
    background: #2563EB;
    opacity: .35;
    animation: omDot 1.1s ease-in-out infinite;
}
.om-busy-swal__dots span:nth-child(2) { animation-delay: .15s; }
.om-busy-swal__dots span:nth-child(3) { animation-delay: .3s; }
.swal2-popup.om-result-swal {
    border-radius: 16px !important;
    border: 1px solid #E2E8F0 !important;
}

/* legacy aliases (unused) */
.om-busy-popup { background: transparent !important; box-shadow: none !important; }
.om-busy { display: none; }

@keyframes omSpin { to { transform: rotate(360deg); } }
@keyframes omDot {
    0%, 80%, 100% { opacity: .25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

/* ── Brand panel ─────────────────────────────────────────── */
.auth-brand-col {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 36px 40px 32px;
    color: #E2E8F0;
    background:
        radial-gradient(ellipse 70% 55% at 85% 15%, rgba(37, 99, 235, 0.35), transparent 60%),
        radial-gradient(ellipse 50% 40% at 10% 90%, rgba(14, 165, 233, 0.18), transparent 55%),
        linear-gradient(165deg, #0B1120 0%, #111827 48%, #0B1120 100%);
    overflow: hidden;
}
.auth-brand-col::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
    pointer-events: none;
}
.auth-brand-eyebrow {
    position: relative;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #93C5FD;
}
.auth-brand-headline {
    position: relative;
    margin: 18px 0 12px;
    font-size: clamp(36px, 4.2vw, 48px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: #F8FAFC;
}
.auth-brand-copy {
    position: relative;
    max-width: 360px;
    font-size: 15px;
    line-height: 1.6;
    color: #94A3B8;
    margin: 0 0 36px;
}
.auth-funnel {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 340px;
}
.auth-funnel__item {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 14px;
    align-items: start;
    padding: 10px 0;
    position: relative;
}
.auth-funnel__item:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 13px;
    top: 36px;
    bottom: -2px;
    width: 2px;
    background: rgba(148, 163, 184, 0.25);
}
.auth-funnel__dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.35);
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    color: #94A3B8;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1;
}
.auth-funnel__item.is-active .auth-funnel__dot,
.auth-funnel__item.is-done .auth-funnel__dot {
    border-color: #60A5FA;
    background: var(--brand-600);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25);
}
.auth-funnel__item.is-done:not(.is-active) .auth-funnel__dot {
    background: rgba(37, 99, 235, 0.35);
    box-shadow: none;
}
.auth-funnel__label {
    font-size: 13.5px;
    font-weight: 600;
    color: #CBD5E1;
    padding-top: 4px;
}
.auth-funnel__item.is-active .auth-funnel__label { color: #F8FAFC; }
.auth-funnel__hint {
    font-size: 12px;
    color: #64748B;
    margin-top: 2px;
    font-weight: 500;
}
.auth-brand-footer {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #64748B;
    padding-top: 28px;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}
.auth-brand-footer span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.auth-brand-footer i { color: #60A5FA; }

@media (max-width: 960px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-brand-col { display: none; }
    .auth-form-col { min-height: 100vh; }
    .auth-form-wrap { max-width: 480px; }
}

@media (max-width: 520px) {
    .auth-row { grid-template-columns: 1fr; }
    .auth-form-top,
    .auth-progress { margin-left: 16px; margin-right: 16px; padding-left: 0; padding-right: 0; }
    .auth-form-top { padding-top: 18px; }
    .auth-form-main { padding: 24px 16px 36px; }
    .auth-otp .otp-input { width: 42px; height: 48px; font-size: 18px; }
}
