/* ===================================================
   Auth Pages (Login & Register)
   =================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #04255C;
    --accent: #CFA65B;
    --accent-hover: #E3C263;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

body {
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f2f5;
    background-image: url("https://images.unsplash.com/photo-1589829545856-d10d557cf95f?auto=format&fit=crop&q=80&w=1600");
    background-size: cover;
    background-position: center;
    position: relative;
    padding: 2rem 1rem;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(4,37,92,0.92) 0%, rgba(4,20,50,0.96) 100%);
    z-index: 0;
}

.bg-circle { position: fixed; border-radius: 50%; pointer-events: none; z-index: 0; }
.bg-circle-1 { width: 500px; height: 500px; top: -200px; right: -150px; background: radial-gradient(circle, rgba(207,166,91,0.12) 0%, transparent 70%); }
.bg-circle-2 { width: 400px; height: 400px; bottom: -150px; left: -100px; background: radial-gradient(circle, rgba(207,166,91,0.08) 0%, transparent 70%); }

.auth-wrapper { position: relative; z-index: 1; width: 100%; max-width: 480px; }

.auth-back {
    display: inline-flex; align-items: center; gap: 8px;
    color: rgba(255,255,255,0.65); font-size: 0.875rem;
    margin-bottom: 1.5rem; transition: color 0.2s; text-decoration: none;
}
.auth-back:hover { color: var(--accent); }

.auth-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 32px 64px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
}

.auth-card-header {
    background: var(--primary);
    padding: 2rem 2.5rem 1.8rem;
    text-align: center;
    position: relative;
}
.auth-card-header::after {
    content: "";
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.auth-logo-row {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; margin-bottom: 1.2rem;
}
.auth-logo-row img {
    width: 44px; height: 44px;
    object-fit: contain;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    padding: 3px;
}
.auth-firm-name {
    font-family: var(--font-heading); font-size: 1.1rem;
    color: #fff; line-height: 1.25; text-align: left;
}
.auth-firm-name span {
    display: block; font-family: var(--font-body); font-size: 0.7rem;
    letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--accent); font-weight: 500;
}
.auth-card-title { font-family: var(--font-heading); font-size: 1.7rem; color: #fff; margin-bottom: 0.3rem; }
.auth-card-subtitle { font-size: 0.875rem; color: rgba(255,255,255,0.55); }

.auth-card-body { padding: 2rem 2.5rem 2.5rem; }

.auth-alert {
    padding: 0.75rem 1rem; border-radius: 8px;
    font-size: 0.85rem; display: flex; align-items: flex-start;
    gap: 10px; margin-bottom: 1.5rem;
}
.auth-alert-error { background: #fef2f2; border-left: 3px solid #ef4444; color: #991b1b; }
.auth-alert-success { background: #f0fdf4; border-left: 3px solid #22c55e; color: #166534; }

/* Register: two-column field row */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.auth-field { margin-bottom: 1.25rem; }
.auth-field label {
    display: block; font-size: 0.8rem; font-weight: 600;
    color: #374151; letter-spacing: 0.5px;
    text-transform: uppercase; margin-bottom: 0.5rem;
}
.auth-field-wrap { position: relative; }
.field-icon {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    color: #9ca3af; font-size: 0.875rem; pointer-events: none;
}
.auth-field input, .auth-field select {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.7rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: #111827;
    background: #f9fafb;
    transition: all 0.2s;
    appearance: none;
}
.auth-field input:focus, .auth-field select:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(207,166,91,0.12);
}

.toggle-btn {
    position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: #9ca3af; cursor: pointer;
    padding: 4px; font-size: 0.875rem; transition: color 0.2s;
}
.toggle-btn:hover { color: var(--primary); }

/* Login: remember me / forgot password row */
.auth-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: #6b7280; cursor: pointer; }
.check-label input { accent-color: var(--accent); width: 15px; height: 15px; }
.auth-link { font-size: 0.85rem; color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-link:hover { color: var(--primary); }

/* Register: password strength */
.strength-bar { height: 3px; background: #e5e7eb; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.strength-fill { height: 100%; width: 0; border-radius: 2px; transition: width 0.3s, background 0.3s; }
.strength-label { font-size: 0.73rem; color: #9ca3af; margin-top: 4px; }
.match-msg { font-size: 0.73rem; margin-top: 4px; }

/* Register: terms checkbox */
.auth-terms { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 1.25rem; }
.auth-terms input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px; cursor: pointer; }
.auth-terms-text { font-size: 0.83rem; color: #6b7280; line-height: 1.6; }
.auth-terms-text a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-terms-text a:hover { color: var(--primary); }

.auth-btn {
    width: 100%; padding: 0.9rem;
    background: var(--accent); color: var(--primary);
    font-family: var(--font-body); font-size: 0.95rem;
    font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
    border: none; border-radius: 8px; cursor: pointer;
    transition: all 0.25s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-btn:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(207,166,91,0.35); }
.auth-btn:active { transform: translateY(0); }

.auth-or { display: flex; align-items: center; gap: 12px; font-size: 0.8rem; color: #9ca3af; margin: 1.5rem 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: #e5e7eb; }

.auth-social-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.auth-social-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 0.7rem; border: 1.5px solid #e5e7eb; border-radius: 8px;
    background: #fff; color: #374151; font-size: 0.85rem;
    font-weight: 500; cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.auth-social-btn:hover { border-color: var(--accent); color: var(--primary); background: #fffbf3; }

.auth-card-footer {
    text-align: center; padding: 1rem 2.5rem 1.5rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.875rem; color: #6b7280;
}
.auth-card-footer a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-card-footer a:hover { color: var(--primary); }

.auth-credit { text-align: center; margin-top: 1.5rem; font-size: 0.78rem; color: rgba(255,255,255,0.35); letter-spacing: 0.3px; }

@media (max-width: 520px) {
    html, body { overflow-x: hidden; }
    .auth-wrapper { max-width: 100%; padding: 1rem; }
    .auth-card { border-radius: 16px; }
    .auth-card-header { padding: 1.5rem 1.25rem 1.25rem; }
    .auth-card-body { padding: 1.25rem 1.25rem 1.75rem; }
    .auth-card-footer { padding: 0.9rem 1.25rem 1.25rem; }
    .auth-card-title { font-size: 1.35rem; }
    .auth-card-subtitle { font-size: 0.85rem; }
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .auth-btn { padding: 0.85rem; font-size: 0.9rem; }
    .auth-logo-row img { width: 38px; height: 38px; }
    .auth-firm-name { font-size: 0.95rem; }
}

@media (max-width: 380px) {
    .auth-card-header { padding: 1.25rem 1rem 1rem; }
    .auth-card-body { padding: 1rem 1rem 1.5rem; }
    .auth-input { padding: 0.7rem 0.7rem 0.7rem 2.4rem; font-size: 0.9rem; }
}

/* ===================================================
   Forgot Password Modal (Login page only)
   =================================================== */
.fp-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(4,20,50,0.75);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.fp-overlay.active { opacity: 1; pointer-events: all; }
.fp-modal {
    background: #fff; border-radius: 16px;
    width: 100%; max-width: 420px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.45);
    overflow: hidden;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.fp-overlay.active .fp-modal { transform: translateY(0) scale(1); }
.fp-header { background: var(--primary); padding: 1.6rem 2rem; position: relative; }
.fp-header::after {
    content: ""; position: absolute;
    bottom: -1px; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.fp-close {
    position: absolute; top: 1rem; right: 1rem;
    background: rgba(255,255,255,0.1); border: none;
    color: rgba(255,255,255,0.7); width: 32px; height: 32px;
    border-radius: 50%; cursor: pointer; font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.fp-close:hover { background: rgba(255,255,255,0.2); color: #fff; }
.fp-steps { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 1.2rem; }
.fp-step-dot {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.5); font-size: 0.75rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s; position: relative; z-index: 1;
}
.fp-step-dot.active { background: var(--accent); border-color: var(--accent); color: var(--primary); }
.fp-step-dot.done { background: rgba(207,166,91,0.3); border-color: var(--accent); color: var(--accent); }
.fp-step-line { flex: 1; height: 2px; max-width: 48px; background: rgba(255,255,255,0.15); transition: background 0.3s; }
.fp-step-line.done { background: var(--accent); }
.fp-header-title { font-family: var(--font-heading); font-size: 1.3rem; color: #fff; text-align: center; margin-bottom: 0.2rem; }
.fp-header-sub { font-size: 0.8rem; color: rgba(255,255,255,0.5); text-align: center; }
.fp-body { padding: 2rem 2rem 1.6rem; }
.fp-panel { display: none; }
.fp-panel.active { display: block; }
.fp-icon-wrap {
    width: 56px; height: 56px; border-radius: 50%;
    background: rgba(207,166,91,0.1); border: 2px solid rgba(207,166,91,0.25);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 1.2rem;
}
.fp-icon-wrap i { font-size: 1.4rem; color: var(--accent); }
.fp-panel-title { font-family: var(--font-heading); font-size: 1.3rem; color: var(--primary); text-align: center; margin-bottom: 0.4rem; }
.fp-panel-desc { font-size: 0.855rem; color: #6b7280; text-align: center; margin-bottom: 1.6rem; line-height: 1.65; }
.fp-panel-desc strong { color: var(--primary); }
.fp-field { margin-bottom: 1.2rem; }
.fp-label { display: block; font-size: 0.78rem; font-weight: 600; color: #374151; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 0.45rem; }
.fp-input-wrap { position: relative; }
.fp-input-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #9ca3af; font-size: 0.875rem; pointer-events: none; }
.fp-input {
    width: 100%; padding: 0.8rem 1rem 0.8rem 2.6rem;
    border: 1.5px solid #e5e7eb; border-radius: 8px;
    font-family: var(--font-body); font-size: 0.92rem;
    color: #111827; background: #f9fafb; transition: all 0.2s;
}
.fp-input:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(207,166,91,0.12); }
.fp-toggle { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #9ca3af; cursor: pointer; font-size: 0.875rem; padding: 4px; transition: color 0.2s; }
.fp-toggle:hover { color: var(--primary); }
.otp-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 0.5rem; }
.otp-box {
    width: 48px; height: 52px;
    border: 1.5px solid #e5e7eb; border-radius: 8px;
    font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700;
    color: var(--primary); text-align: center; background: #f9fafb;
    transition: all 0.2s; caret-color: var(--accent);
}
.otp-box:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(207,166,91,0.12); }
.otp-box.filled { border-color: var(--accent); background: rgba(207,166,91,0.05); }
.otp-resend { text-align: center; font-size: 0.82rem; color: #6b7280; margin-top: 0.8rem; }
.otp-resend button { background: none; border: none; color: var(--accent); font-weight: 600; cursor: pointer; font-size: 0.82rem; padding: 0; }
.otp-resend button:hover { color: var(--primary); }
.otp-resend button:disabled { color: #9ca3af; cursor: not-allowed; }
#otpTimer { color: #9ca3af; }
.fp-error {
    background: #fef2f2; border-left: 3px solid #ef4444;
    color: #991b1b; padding: 0.65rem 0.9rem;
    border-radius: 6px; font-size: 0.82rem;
    display: none; align-items: center; gap: 8px; margin-bottom: 1rem;
}
.fp-error.show { display: flex; }
.fp-success { text-align: center; padding: 1rem 0 0.5rem; }
.fp-success-icon {
    width: 68px; height: 68px; border-radius: 50%;
    background: rgba(207,166,91,0.12); border: 3px solid var(--accent);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.2rem; animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fp-success-icon i { font-size: 1.8rem; color: var(--accent); }
.fp-success h3 { font-family: var(--font-heading); font-size: 1.4rem; color: var(--primary); margin-bottom: 0.5rem; }
.fp-success p { font-size: 0.875rem; color: #6b7280; line-height: 1.65; }
.fp-footer { padding: 0 2rem 2rem; }
.fp-btn {
    width: 100%; padding: 0.88rem;
    background: var(--accent); color: var(--primary);
    font-family: var(--font-body); font-size: 0.92rem;
    font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
    border: none; border-radius: 8px; cursor: pointer; transition: all 0.25s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.fp-btn:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(207,166,91,0.35); }
.fp-btn:active { transform: translateY(0); }
.fp-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.fp-btn-ghost {
    width: 100%; padding: 0.7rem;
    background: none; border: none; color: #6b7280;
    font-size: 0.85rem; cursor: pointer; margin-top: 0.6rem; transition: color 0.2s;
}
.fp-btn-ghost:hover { color: var(--primary); }
