/* ========================================
   Auth Pages — Standalone Login & Register
   ======================================== */
.auth-page {
    min-height: 100vh;
    background: var(--off-white);
    font-family: var(--font);
    overflow-x: hidden;
}

.auth-wrapper {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Brand Panel (left) ── */
.auth-brand-panel {
    flex: 0 0 45%;
    background: url('https://images.unsplash.com/photo-1506929562872-bb421503ef21?w=1200&h=900&fit=crop') center/cover no-repeat;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 48px;
}
.auth-brand-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(5,150,105,0.85) 0%, rgba(15,23,42,0.8) 100%);
}
.auth-brand-content {
    position: relative;
    z-index: 1;
    color: #fff;
}
.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    margin-bottom: 24px;
}
.auth-logo i { font-size: 28px; }
.auth-logo span { font-weight: 800; }
.auth-brand-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}
.auth-brand-content p {
    font-size: 15px;
    opacity: 0.85;
    margin-bottom: 32px;
}
.auth-brand-stats {
    display: flex;
    gap: 32px;
}
.auth-stat {
    display: flex;
    flex-direction: column;
}
.auth-stat strong {
    font-size: 24px;
    font-weight: 700;
}
.auth-stat span {
    font-size: 12px;
    opacity: 0.7;
}

/* ── Form Panel (right) ── */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.auth-form-container {
    width: 100%;
    max-width: 420px;
}
.auth-form-container h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.auth-subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 28px;
}

/* ── Shared form styles ── */
.auth-alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}
.auth-alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.auth-alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.auth-field {
    margin-bottom: 16px;
}
.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}
.auth-optional {
    color: var(--gray);
    font-weight: 400;
}
.auth-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    transition: border-color 0.25s, box-shadow 0.25s;
    padding: 0 12px;
}
.auth-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5,150,105,0.1);
}
.auth-input-wrap i {
    color: var(--gray);
    font-size: 16px;
    flex-shrink: 0;
}
.auth-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 10px;
    font-size: 14px;
    font-family: var(--font);
    background: transparent;
    color: var(--text);
}
.auth-input-wrap input::placeholder { color: var(--gray); }

.auth-toggle-pw {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: color 0.2s;
}
.auth-toggle-pw:hover { color: var(--text); }

.auth-field-error {
    display: block;
    font-size: 12px;
    color: #dc2626;
    margin-top: 4px;
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
}
.auth-checkbox input {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
}
.auth-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.auth-link:hover { text-decoration: underline; }

.auth-submit-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.25s, transform 0.15s;
}
.auth-submit-btn:hover { background: var(--primary-hover); }
.auth-submit-btn:active { transform: scale(0.98); }
.auth-submit-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--gray);
    font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-social-btn {
    width: 100%;
    padding: 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: border-color 0.25s, background 0.25s;
}
.auth-social-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--primary-ultra-light);
}
.auth-social-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-switch {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    margin-top: 20px;
}

/* ── Login Method Tabs ── */
.auth-method-tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
}
.auth-method-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    font-family: var(--font);
}
.auth-method-tab:hover { background: #e2e8f0; }
.auth-method-tab.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.auth-method-panel { display: none; }
.auth-method-panel.active { display: block; }

/* ── Phone Prefix ── */
.auth-phone-prefix {
    position: absolute;
    left: 38px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    pointer-events: none;
}
.auth-input-wrap .auth-phone-prefix ~ input {
    padding-left: 72px;
}

/* ── OTP Inputs ── */
.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 8px 0 20px;
}
.otp-digit {
    width: 48px;
    height: 54px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
    font-family: var(--font);
    color: var(--text);
}
.otp-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5,150,105,0.1);
}

/* ── OTP Info ── */
.otp-sent-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 13px;
    color: #16a34a;
    margin-bottom: 20px;
}
.otp-sent-info i { font-size: 16px; }

.otp-resend-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 12.5px;
    color: var(--text-light);
}
.otp-divider {
    color: #cbd5e1;
}
.auth-link-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    font-size: 12.5px;
    padding: 0;
    font-family: var(--font);
}
.auth-link-btn:hover { text-decoration: underline; }

.auth-btn-success {
    background: #16a34a !important;
    pointer-events: none;
}

/* ── Registration OTP Trigger Button ── */
.auth-otp-trigger {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.auth-otp-trigger:hover { background: var(--primary-dark, #047857); }
.auth-otp-trigger:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Verified Badge ── */
.auth-verified-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #16a34a;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
}
.auth-verified-badge i { font-size: 16px; }

/* ── Small Submit Button for OTP ── */
.auth-btn-sm {
    padding: 10px 20px;
    font-size: 14px;
}

/* ── Auth Hint Text ── */
.auth-hint {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
    text-align: center;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .auth-brand-panel { display: none; }
    .auth-form-panel {
        padding: 24px 16px;
        align-items: flex-start;
        padding-top: 32px;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    .auth-form-container {
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
    }
    .auth-form-container h2 {
        font-size: 22px;
    }
    .auth-subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }

    /* Method tabs — smaller on mobile */
    .auth-method-tabs {
        margin-bottom: 18px;
    }
    .auth-method-tab {
        padding: 9px 10px;
        font-size: 12.5px;
        gap: 5px;
    }

    /* OTP digit boxes — scale down for small screens */
    .otp-inputs {
        gap: 6px;
        max-width: 100%;
    }
    .otp-digit {
        width: 40px;
        height: 46px;
        font-size: 18px;
        border-radius: 8px;
    }

    /* Phone prefix fix */
    .auth-phone-prefix {
        left: 36px;
        font-size: 13px;
    }

    /* Prevent input wraps from overflowing */
    .auth-input-wrap {
        max-width: 100%;
        overflow: hidden;
    }

    .auth-submit-btn {
        padding: 11px;
        font-size: 14px;
    }
    .auth-options {
        flex-wrap: wrap;
        gap: 8px;
    }
    .otp-resend-row {
        flex-wrap: wrap;
        gap: 6px;
    }
    .otp-sent-info {
        font-size: 12px;
        padding: 8px 10px;
    }
    .auth-social-btn {
        font-size: 13px;
        padding: 9px;
    }

    /* Phone input with verify button — prevent overflow */
    .auth-otp-trigger {
        padding: 4px 10px;
        font-size: 12px;
    }
    .auth-input-wrap input {
        padding: 9px 8px;
        font-size: 13px;
        min-width: 0;
    }

    /* Reduce spacing between fields on register */
    .auth-field {
        margin-bottom: 12px;
    }
    .auth-field label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    /* Verified badge */
    .auth-verified-badge {
        font-size: 12px;
        padding: 6px 10px;
    }

    /* Checkbox + terms text */
    .auth-checkbox {
        font-size: 12px;
    }
    .auth-checkbox input {
        width: 14px;
        height: 14px;
    }

    /* Divider & switch */
    .auth-divider {
        margin: 14px 0;
    }
    .auth-switch {
        font-size: 12px;
        margin-top: 14px;
    }
}

@media (max-width: 360px) {
    .auth-form-panel {
        padding: 20px 12px;
    }
    .otp-inputs {
        gap: 4px;
    }
    .otp-digit {
        width: 36px;
        height: 42px;
        font-size: 16px;
        border-width: 1.5px;
    }
    .auth-method-tab {
        padding: 8px 6px;
        font-size: 11.5px;
    }
    .auth-method-tab i {
        font-size: 13px;
    }
    .auth-otp-trigger {
        padding: 3px 8px;
        font-size: 11px;
    }
    .auth-phone-prefix {
        left: 34px;
        font-size: 12px;
    }
    .auth-form-container h2 {
        font-size: 20px;
    }
}
