/* =============================================
   AL-ZARA — AUTH PAGES (LOGIN / REGISTER) CSS
   ============================================= */

/* --- DESIGN TOKENS (mirrored from landing.css) --- */
:root {
    --gold: #c8933a;
    --gold-light: #e8b55a;
    --gold-dark: #a07020;
    --navy: #0e1d35;
    --navy-mid: #162340;
    --navy-light: #1e3057;
    --white: #ffffff;
    --off-white: #f8f6f2;
    --gray-light: #e8e8e8;
    --gray-text: #666;
    --text-dark: #111827;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --font-main: 'Inter', 'Outfit', system-ui, sans-serif;
    --font-heading: 'Outfit', 'Inter', system-ui, sans-serif;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.18);
}

/* --- RESET --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-main); background: var(--navy); color: var(--text-dark); overflow-x: hidden; line-height: 1.6; min-height: 100vh; }
a { text-decoration: none; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

/* =============================================
   BACKGROUND
   ============================================= */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.auth-bg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        #060d1a 0%,
        #0e1d35 35%,
        #1a3362 65%,
        #0e1d35 100%);
}

.auth-bg-gradient--register {
    background: linear-gradient(135deg,
        #060d1a 0%,
        #0e1d35 35%,
        #1e3057 65%,
        #0a1520 100%);
}

.auth-bg-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(200,147,58,0.06) 1px, transparent 1px);
    background-size: 36px 36px;
    animation: bgDrift 30s linear infinite;
}

@keyframes bgDrift {
    from { background-position: 0 0; }
    to   { background-position: 72px 72px; }
}

/* Floating orbs */
.auth-bg-orbs { position: absolute; inset: 0; }

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.25;
    animation: orbFloat 12s ease-in-out infinite;
}

.orb-1 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
    top: -100px; left: -100px;
    animation-delay: 0s;
}
.orb-2 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, #1a6fb5 0%, transparent 70%);
    bottom: -80px; right: -80px;
    animation-delay: 4s;
}
.orb-3 {
    width: 250px; height: 250px;
    background: radial-gradient(circle, var(--gold-dark) 0%, transparent 70%);
    top: 50%; right: 25%;
    transform: translateY(-50%);
    animation-delay: 8s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(20px, -20px) scale(1.05); }
    66%  { transform: translate(-15px, 15px) scale(0.97); }
}

/* =============================================
   LAYOUT — SPLIT PANELS
   ============================================= */
.auth-layout {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* Register page swaps the columns */
.auth-layout--register {
    grid-template-columns: 1fr 1fr;
}

/* =============================================
   BRAND PANEL (LEFT)
   ============================================= */
.auth-brand-panel {
    padding: 48px 52px;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    overflow: hidden;
    justify-content: space-between;
}

.auth-brand-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

/* Logo */
.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-badge {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    flex-shrink: 0;
}

.logo-az {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 0.5px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-main {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 1px;
}

.logo-sub {
    font-size: 0.56rem;
    font-weight: 600;
    color: rgba(200,147,58,0.8);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Brand hero text */
.brand-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    padding: 32px 0;
}

.brand-tagline {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    font-weight: 900;
    color: var(--white);
    line-height: 1.15;
    letter-spacing: -1px;
}

.brand-tagline .gold { color: var(--gold-light); }

.brand-desc {
    font-size: 0.92rem;
    color: rgba(255,255,255,0.72);
    line-height: 1.75;
    max-width: 380px;
}

/* Perks list */
.brand-perks {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brand-perks li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255,255,255,0.88);
    padding: 10px 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    transition: background var(--transition), border-color var(--transition);
}

.brand-perks li:hover {
    background: rgba(200,147,58,0.12);
    border-color: rgba(200,147,58,0.3);
}

.brand-perks li i {
    color: var(--gold-light);
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Stats row (register only) */
.stats-row {
    display: flex;
    gap: 16px;
}

.stat-item {
    flex: 1;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(200,147,58,0.2);
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    transition: background var(--transition);
}

.stat-item:hover { background: rgba(200,147,58,0.12); }

.stat-num {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--gold-light);
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    letter-spacing: 0.3px;
}

/* Brand footer */
.brand-footer-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    font-weight: 500;
}

.brand-footer-text i { color: rgba(200,147,58,0.6); }

/* =============================================
   FORM PANEL (RIGHT)
   ============================================= */
.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 40px;
    background: var(--white);
    position: relative;
}

/* Subtle left-edge accent */
.auth-form-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Mobile logo (hidden on desktop) */
.auth-logo-mobile { display: none; }

/* Card header */
.auth-card-header { margin-bottom: -4px; }

.auth-title {
    font-family: var(--font-heading);
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--text-dark);
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 0.88rem;
    color: var(--gray-text);
}

.auth-subtitle a {
    color: var(--gold-dark);
    font-weight: 700;
    transition: color var(--transition);
}
.auth-subtitle a:hover { color: var(--gold); }

/* =============================================
   SOCIAL LOGIN
   ============================================= */
.social-login-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 20px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font-main);
    color: var(--text-dark);
    background: var(--white);
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.social-btn:hover {
    border-color: rgba(200,147,58,0.4);
    background: #fffdf8;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

/* =============================================
   DIVIDER
   ============================================= */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gray-text);
    font-size: 0.78rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-light);
}

/* =============================================
   FORM FIELDS
   ============================================= */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.auth-field label {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.auth-field label i { color: var(--gold); font-size: 0.7rem; }

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap input {
    width: 100%;
    padding: 11px 14px;
    font-size: 0.92rem;
    font-family: var(--font-main);
    color: var(--text-dark);
    background: var(--off-white);
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.input-wrap input:focus {
    border-color: var(--gold);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(200,147,58,0.12);
}

.input-wrap input.input-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}

.input-wrap input.input-valid {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(22,163,74,0.08);
}

/* Phone prefix */
.phone-wrap { overflow: hidden; border: 1.5px solid var(--gray-light); border-radius: var(--radius-sm); background: var(--off-white); transition: border-color var(--transition), box-shadow var(--transition); }
.phone-wrap:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,147,58,0.12); background: var(--white); }
.phone-prefix { padding: 0 12px; font-size: 0.88rem; font-weight: 700; color: var(--navy); border-right: 1.5px solid var(--gray-light); background: rgba(14,29,53,0.04); white-space: nowrap; display: flex; align-items: center; }
.phone-wrap input { border: none; border-radius: 0; background: transparent; box-shadow: none !important; padding-left: 12px; }
.phone-wrap:focus-within { background: var(--white); }

/* Password toggle */
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-text);
    font-size: 0.85rem;
    padding: 4px;
    transition: color var(--transition);
    display: flex;
    align-items: center;
}
.toggle-password:hover { color: var(--gold); }

/* Errors */
.field-error {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--danger);
    min-height: 14px;
    display: block;
    animation: errShake 0.3s ease;
}

@keyframes errShake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-4px); }
    75%       { transform: translateX(4px); }
}

/* Password strength */
.strength-bar {
    height: 4px;
    background: var(--gray-light);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.4s ease, background-color 0.4s ease;
}

.strength-label {
    font-size: 0.72rem;
    font-weight: 700;
    display: block;
    margin-top: 2px;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--gray-text);
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--gray-light);
    border-radius: 4px;
    background: var(--off-white);
    flex-shrink: 0;
    margin-top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition), background var(--transition);
    position: relative;
}

.checkbox-label input:checked + .checkmark {
    background: var(--gold);
    border-color: var(--gold);
}

.checkbox-label input:checked + .checkmark::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid var(--white);
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translate(-1px, -1px);
}

.checkbox-label a {
    color: var(--gold-dark);
    font-weight: 600;
    transition: color var(--transition);
}
.checkbox-label a:hover { color: var(--gold); }

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.forgot-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gold-dark);
    transition: color var(--transition);
    white-space: nowrap;
}
.forgot-link:hover { color: var(--gold); }

/* =============================================
   SUBMIT BUTTON
   ============================================= */
.auth-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-main);
    color: var(--white);
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}

.auth-submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(200,147,58,0) 0%, rgba(200,147,58,0.15) 100%);
    opacity: 0;
    transition: opacity var(--transition);
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(14,29,53,0.35);
}

.auth-submit-btn:hover::before { opacity: 1; }
.auth-submit-btn:active { transform: translateY(0); }
.auth-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.auth-legal {
    font-size: 0.74rem;
    color: var(--gray-text);
    text-align: center;
    line-height: 1.6;
}
.auth-legal a { color: var(--gold-dark); font-weight: 600; }
.auth-legal a:hover { color: var(--gold); }

/* Mobile switch link (hidden on desktop) */
.auth-switch-mobile { display: none; }

/* =============================================
   FORGOT PASSWORD MODAL
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6,13,26,0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: none;
    border: none;
    color: var(--gray-text);
    font-size: 1rem;
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--off-white); color: var(--text-dark); }

.modal-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(200,147,58,0.1);
    border: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--gold);
    margin-bottom: 16px;
}

.modal-card h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.modal-card p {
    font-size: 0.88rem;
    color: var(--gray-text);
    line-height: 1.6;
    margin-bottom: 20px;
}

#forgot-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* =============================================
   SUCCESS TOAST
   ============================================= */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    color: #166534;
    padding: 14px 24px;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    z-index: 2000;
    transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.4s ease;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast i { font-size: 1rem; color: var(--success); }

/* =============================================
   RESPONSIVE
   ============================================= */

/* Tablet */
@media (max-width: 1024px) {
    .auth-brand-panel { padding: 40px 36px; }
    .auth-form-panel { padding: 32px 28px; }
    .brand-tagline { font-size: 2rem; }
}

/* Mobile — Stack vertically */
@media (max-width: 820px) {
    .auth-layout {
        grid-template-columns: 1fr;
    }

    /* Hide the brand panel on mobile */
    .auth-brand-panel { display: none; }

    .auth-form-panel {
        min-height: 100vh;
        padding: 32px 24px;
        align-items: flex-start;
        padding-top: 48px;
    }

    .auth-form-panel::before { display: none; }

    .auth-card { max-width: 100%; }

    /* Show mobile logo */
    .auth-logo-mobile {
        display: inline-flex;
        margin-bottom: 4px;
    }

    .auth-switch-mobile {
        display: block;
        text-align: center;
        font-size: 0.86rem;
        color: var(--gray-text);
        padding-top: 8px;
        border-top: 1px solid var(--gray-light);
    }

    .auth-switch-mobile a {
        color: var(--gold-dark);
        font-weight: 700;
    }
}

@media (max-width: 480px) {
    .form-row-2col { grid-template-columns: 1fr; }
    .auth-form-panel { padding: 28px 20px; }
    .social-btn { font-size: 0.82rem; }
}
