:root {
    --primary: #543ae3;
    --primary-dark: #4630c4;
    --primary-light: #f3f0ff;
    --bg: #ffffff;
    --primary-bg: #f8f7ff;
    --text: #111827;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
}

.flex-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    background: var(--bg);
    font-family: "Nunito", sans-serif;
}

.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 3.5rem;
    color: #fff;
    background: linear-gradient(135deg, #543ae3 0%, #6246ea 40%, #7c3aed 100%);
}

.auth-badge {
    display: inline-block;
    width: fit-content;
    margin-bottom: 1.5rem;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    font-size: 14px;
    font-weight: 700;
}

.auth-brand h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 1rem;
}

.auth-brand p {
    max-width: 480px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.05rem;
    line-height: 1.6;
}

.auth-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 3.5rem;
    background: var(--bg);
}

.auth-step {
    display: none;
}

.auth-step.is-active {
    display: block;
}

.auth-form-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.auth-form-header p {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

.step-desc-otp {
    line-height: 1.65;
}

.step-desc-phone {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    vertical-align: baseline;
    white-space: nowrap;
}

.step-desc-phone-prefix {
    font-weight: 700;
    color: var(--text);
}

.step-desc-phone-input {
    width: 105px;
    padding: 2px 4px;
    border: none;
    border-bottom: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    outline: none;
}

.step-desc-phone-input:focus {
    border-bottom-color: var(--primary-dark);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.form-input,
.form-select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(84, 58, 227, 0.12);
}

.input-wrap {
    position: relative;
}

.form-input.has-prefix {
    padding-left: 58px;
}

.phone-prefix {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 15px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform var(--transition-fast), background-color var(--transition-base), box-shadow var(--transition-base);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
    box-shadow: 0 12px 28px rgba(84, 58, 227, 0.28);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

.step-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.step-dot.is-active {
    background: var(--primary);
    transform: scale(1.15);
}

.step-dot.is-done {
    background: #a78bfa;
}

.method-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.method-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.method-card:hover,
.method-card.is-selected {
    transform: translateY(-2px);
    border-color: rgba(84, 58, 227, 0.35);
    box-shadow: 0 10px 24px rgba(84, 58, 227, 0.1);
}

.method-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 18px;
    flex-shrink: 0;
}

.method-icon.purple {
    background: #ede9fe;
    color: var(--primary);
}

.method-icon.green {
    background: #dcfce7;
    color: #16a34a;
}

.method-icon.sms {
    background: #dbeafe;
    color: #2563eb;
}

.method-icon.wa {
    background: #dcfce7;
    color: #16a34a;
}

.method-card h4 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.method-card p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.otp-hint {
    margin-bottom: 1.25rem;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}

.otp-inputs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 1rem;
}

.otp-inputs input {
    width: 100%;
    aspect-ratio: 1;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
}

.otp-inputs input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(84, 58, 227, 0.12);
}

.otp-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.otp-timer {
    margin: 0 0 1rem;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

.otp-timer strong {
    color: var(--primary);
}

.otp-resend-options {
    margin-bottom: 1.25rem;
}

.otp-resend-label {
    margin: 0 0 0.75rem;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}

.otp-resend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.auth-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 3rem;
    background: var(--bg);
}

.auth-nav img {
    width: 160px;
    height: auto;
}

.auth-nav-link {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
}

.auth-brand::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    left: -80px;
    bottom: -60px;
}

.auth-brand h1 span {
    color: #ffd54f;
}

.auth-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.auth-stat {
    padding: 1.25rem 1rem;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-stat:last-child {
    border-right: none;
}

.auth-stat h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.auth-stat p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    margin: 0;
}

.input-wrap.has-icon > i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
    pointer-events: none;
}

.input-wrap.has-icon .form-input {
    padding-left: 44px;
}

.input-wrap.has-icon:focus-within > i {
    color: var(--primary);
}

.input-wrap.has-toggle .form-input {
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 15px;
}

.toggle-password:hover {
    color: var(--primary);
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}

.checkbox-wrap input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.forgot-link {
    font-size: 14px;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.forgot-link:hover {
    text-decoration: underline;
}

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 1.75rem 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

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

.btn-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-social:hover {
    transform: translateY(-2px);
    border-color: rgba(84, 58, 227, 0.25);
    box-shadow: 0 8px 20px rgba(15, 23, 36, 0.06);
}

.auth-switch {
    margin-top: 2rem;
    text-align: center;
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 600;
    
}

.back-step {
    margin-bottom: 1rem;
}

#flow-header {
    display: none;
}

#flow-header.is-visible {
    display: block;
}

.auth-login-error {
    margin-bottom: 1rem;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: #fef2f2;
    color: #dc2626;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 992px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        padding: 2rem 1.5rem;
        min-height: auto;
    }

    .auth-form-panel {
        padding: 2rem 1.5rem;
    }

    .auth-nav {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 576px) {
    .auth-nav {
        padding: 1rem 1.25rem;
    }

    .auth-nav img {
        width: 130px;
    }

    .auth-form-panel,
    .auth-brand {
        padding: 1.5rem 1rem;
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .otp-inputs {
        gap: 6px;
    }

    .otp-inputs input {
        height: 44px;
        font-size: 1rem;
        padding: 0;
    }

    .otp-resend-grid {
        grid-template-columns: 1fr;
    }

    .auth-form-header h2 {
        font-size: 1.35rem;
    }
}

/* 404 Page */
.not-found-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--primary-bg);
    font-family: "Nunito", sans-serif;
}

.not-found-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
}

.not-found-content {
    text-align: center;
    max-width: 480px;
}

.not-found-code {
    display: block;
    font-size: clamp(6rem, 18vw, 9rem);
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #543ae3 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.not-found-content h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.not-found-content p {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.not-found-content .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
}

/* User nav + auth buttons moved to /web-static/cssapp-nav.css */

.mobile-user-name {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}


