/* Auth pages — signup & login */

body.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: row;
    background: var(--color-bg-subtle);
    overflow-x: hidden;
}

.auth-panel-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px;
    background: linear-gradient(160deg, #0F172A 0%, #1E293B 50%, #312E81 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-panel-left::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(var(--brand-rgb), 0.3) 0%, transparent 70%);
}

.auth-panel-left::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 194, 168, 0.15) 0%, transparent 70%);
}

.auth-panel-content {
    position: relative;
    z-index: 1;
    max-width: 440px;
}

.auth-panel-left .logo {
    color: white;
    margin-bottom: 48px;
}

.auth-panel-left h2 {
    font-size: 2rem;
    margin-bottom: 16px;
    line-height: 1.3;
}

.auth-panel-left > .auth-panel-content > p {
    font-size: 1.0625rem;
    color: #94A3B8;
    line-height: 1.7;
    margin-bottom: 40px;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.auth-feature-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--brand-rgb), 0.2);
    border-radius: var(--radius-md);
    color: #A78BFA;
}

.auth-feature h4 {
    font-size: 0.9375rem;
    margin-bottom: 4px;
}

.auth-feature p {
    font-size: 0.8125rem;
    color: #64748B;
    line-height: 1.5;
}

.auth-panel-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px 32px;
    max-width: 640px;
}

.auth-form-container {
    width: 100%;
    max-width: 440px;
}

.auth-mobile-logo {
    display: none;
    margin-bottom: 32px;
}

.auth-form-header {
    margin-bottom: 32px;
}

.auth-form-header h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.auth-form-header p {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

/* Progress steps */
.signup-progress {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 32px;
}

.progress-step {
    display: flex;
    align-items: center;
    flex: 1;
}

.progress-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    background: var(--color-bg-muted);
    color: var(--color-text-muted);
    border: 2px solid var(--color-border);
    flex-shrink: 0;
    transition: all var(--transition);
}

.progress-step.active .progress-dot {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}

.progress-step.completed .progress-dot {
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.progress-line {
    flex: 1;
    height: 2px;
    background: var(--color-border);
    margin: 0 4px;
}

.progress-step.completed .progress-line,
.progress-step.active .progress-line {
    background: var(--brand-primary-muted);
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    margin-bottom: 32px;
}

.progress-labels span {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    text-align: center;
    flex: 1;
}

.progress-labels span.active {
    color: var(--brand-primary);
    font-weight: 600;
}

/* Form elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.form-group .label-hint {
    font-weight: 400;
    color: var(--color-text-muted);
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.9375rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    background: white;
    color: var(--color-text);
    transition: all var(--transition);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12);
}

.form-input::placeholder { color: var(--color-text-muted); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 6px;
}

.form-error {
    font-size: 0.8125rem;
    color: var(--color-danger);
    margin-top: 6px;
    display: none;
}

.form-group.has-error .form-input {
    border-color: var(--color-danger);
}

.form-group.has-error .form-error { display: block; }

/* Signup method cards */
.signup-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.method-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    background: white;
}

.method-card:hover {
    border-color: var(--brand-primary-muted);
    background: var(--brand-primary-light);
}

.method-card.selected {
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.1);
}

.method-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-subtle);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.method-card.selected .method-icon {
    background: white;
}

.method-card.unavailable-selected {
    border-color: #FCD34D;
    background: #FFFBEB;
}

.method-badge-unavailable {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    background: #FEF3C7;
    color: #D97706;
    vertical-align: middle;
    margin-left: 6px;
}

.unavailable-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #FFFBEB;
    border: 1px solid #FCD34D;
    border-radius: var(--radius-md);
    margin-top: 16px;
    font-size: 0.875rem;
    color: #92400E;
    line-height: 1.5;
}

.unavailable-notice[hidden] { display: none; }

.unavailable-notice svg { flex-shrink: 0; margin-top: 2px; color: #D97706; }

.unavailable-notice strong { display: block; margin-bottom: 4px; color: #78350F; }

.unavailable-notice p { margin: 0; font-size: 0.8125rem; }

.unavailable-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0F172A;
    color: white;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.unavailable-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.btn-google-unavailable {
    opacity: 0.85;
    position: relative;
}

.method-info h4 {
    font-size: 0.9375rem;
    margin-bottom: 2px;
}

.method-info p {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* Account type cards */
.account-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.account-type-card {
    padding: 24px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    background: white;
}

.account-type-card:hover {
    border-color: var(--brand-primary-muted);
}

.account-type-card.selected {
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.1);
}

.account-type-card svg {
    color: var(--brand-primary);
    margin-bottom: 12px;
}

.account-type-card h4 {
    font-size: 0.9375rem;
    margin-bottom: 4px;
}

.account-type-card p {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* Financing interest chips */
.financing-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.chip {
    padding: 10px 18px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    background: white;
    color: var(--color-text-secondary);
}

.chip:hover {
    border-color: var(--brand-primary-muted);
    color: var(--brand-primary);
}

.chip.selected {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

/* Form navigation */
.form-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border-light);
}

.form-nav .btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    padding: 12px 0;
    transition: color var(--transition);
}

.form-nav .btn-back:hover { color: var(--brand-primary); }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.auth-footer-text {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
}

.auth-footer-text a {
    color: var(--brand-primary);
    font-weight: 600;
}

.auth-footer-text a:hover { text-decoration: underline; }

/* Success step */
.success-step {
    text-align: center;
    padding: 24px 0;
}

.success-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    background: var(--brand-accent-light);
    border-radius: 50%;
    color: var(--brand-accent);
}

.success-step h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.success-step > p {
    color: var(--color-text-secondary);
    margin-bottom: 32px;
}

.email-preview-card {
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
    text-align: left;
}

.email-preview-card h4 {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.email-address-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.email-address-display span {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--brand-primary);
    word-break: break-all;
}

.btn-copy {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-primary);
    background: var(--brand-primary-light);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.btn-copy:hover { background: var(--brand-primary-muted); }

.email-preview-note {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 12px;
}

/* Signup step panels */
.signup-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.signup-step.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Checkbox */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--brand-primary);
    flex-shrink: 0;
}

.form-checkbox label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    font-weight: 400;
}

.form-checkbox label a {
    color: var(--brand-primary);
    font-weight: 500;
}

/* Password strength */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: all var(--transition);
}

.strength-fill.weak { width: 33%; background: var(--color-danger); }
.strength-fill.medium { width: 66%; background: var(--color-warning); }
.strength-fill.strong { width: 100%; background: var(--color-success); }

.strength-text {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

@media (max-width: 1024px) {
    body.auth-page {
        flex-direction: column;
    }

    .auth-panel-left { display: none; }
    .auth-panel-right {
        max-width: 100%;
        flex: 1;
        padding: 32px 20px 48px;
    }
    .auth-mobile-logo { display: flex; }
}

@media (max-width: 480px) {
    .auth-panel-right { padding: 24px 16px 40px; }
    .auth-form-header h1 { font-size: 1.5rem; }
    .form-row { grid-template-columns: 1fr; }
    .account-types { grid-template-columns: 1fr; }

    .signup-progress {
        gap: 0;
    }

    .progress-dot {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .progress-labels span {
        font-size: 0.625rem;
    }

    .form-nav {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .form-nav .btn-primary {
        width: 100%;
    }

    .form-nav .btn-back {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
}

/* ---- Multi-service signup ---- */
.auth-form-container.is-wide { max-width: 560px; }
.auth-panel-right:has(.is-wide) { max-width: 720px; }
.signup-step-title { font-size: 1.0625rem; margin: 0 0 4px; }
.signup-step-sub { color: var(--color-text-secondary); font-size: .875rem; margin: 0 0 16px; }
.auth-error-banner { padding: 12px 16px; background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; border-radius: 10px; margin-bottom: 16px; font-size: .875rem; }
.auth-error-banner[hidden] { display: none; }

.svc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.svc-tile { position: relative; cursor: pointer; }
.svc-tile input { position: absolute; opacity: 0; pointer-events: none; }
.svc-tile-body { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--color-border); border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s, background .15s; height: 100%; }
.svc-tile:hover .svc-tile-body { border-color: var(--brand-primary-muted, #9DB7F5); }
.svc-tile-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--color-bg-muted, #F1F5F9); color: var(--brand-primary); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.svc-tile-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.svc-tile-text strong { font-size: .9063rem; }
.svc-tile-text small { font-size: .75rem; color: var(--color-text-muted); line-height: 1.35; }
.svc-tile-check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--color-border); display: inline-flex; align-items: center; justify-content: center; color: transparent; flex-shrink: 0; transition: all .15s; }
.svc-tile input:checked + .svc-tile-body { border-color: var(--brand-primary); background: var(--brand-primary-light, #EEF3FF); box-shadow: 0 0 0 3px rgba(26, 86, 219, .08); }
.svc-tile input:checked + .svc-tile-body .svc-tile-icon { background: var(--brand-primary); color: #fff; }
.svc-tile input:checked + .svc-tile-body .svc-tile-check { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.svc-tile input:focus-visible + .svc-tile-body { outline: 2px solid var(--brand-primary); outline-offset: 2px; }

.seg-toggle { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 12px; background: var(--color-bg-muted, #F1F5F9); }
.seg-toggle label { cursor: pointer; }
.seg-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.seg-toggle span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 9px; font-size: .875rem; font-weight: 600; color: var(--color-text-secondary); transition: all .15s; }
.seg-toggle input:checked + span { background: #fff; color: var(--color-text); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

.svc-detail { border: 1px solid var(--color-border); border-radius: 12px; padding: 14px 16px 16px; margin: 0 0 12px; }
.svc-detail[hidden] { display: none; }
.svc-detail legend { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; font-weight: 700; font-size: .8125rem; color: var(--brand-primary); }
.svc-detail .form-group:last-child { margin-bottom: 0; }
.svc-detail .form-row .form-group { margin-bottom: 0; }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); font-weight: 600; }
.input-prefix .form-input { padding-left: 28px; }

.next-steps { text-align: left; margin-top: 20px; display: grid; gap: 8px; }
.next-steps h4 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); margin: 0 0 4px; }
.next-step { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--color-border); border-radius: 12px; color: var(--color-text); font-weight: 600; text-decoration: none; transition: border-color .15s; }
.next-step:hover { border-color: var(--brand-primary); }
.next-step > span:nth-child(2) { flex: 1; }
.next-step-go { color: var(--brand-primary); }
.is-flip { transform: scaleX(-1); }

@media (max-width: 520px) {
    .svc-grid { grid-template-columns: minmax(0, 1fr); }
}

.input-reveal { position: relative; }
.input-reveal .form-input { padding-right: 46px; }
.input-reveal button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: transparent; color: var(--color-text-muted); border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.input-reveal button:hover, .input-reveal button.is-on { color: var(--brand-primary); background: var(--color-bg-muted, #F1F5F9); }
.auth-footer-text { display: flex; align-items: center; justify-content: center; gap: 6px; }
.svc-detail .financing-chips { margin-bottom: 0; }
