/* ═══════════════════════════════════════════════════════
   deen Spouse — Premium Auth Pages
   Animated, polished, mobile-first design
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Playfair+Display:wght@500;600;700&display=swap');

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

body.auth-body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #ede9fe 0%, #fdf2f8 40%, #e0e7ff 100%);
    padding: 2rem 1.5rem;
    -webkit-font-smoothing: antialiased;
}
body.auth-body.has-navbar {
    display: block;
    padding: 0;
}
.auth-page-shell {
    min-height: calc(100vh - 90px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

/* ── Animated background particles ─────────────────── */
body.auth-body::before,
body.auth-body::after {
    content: ''; position: fixed;
    border-radius: 50%; pointer-events: none;
    filter: blur(100px); opacity: 0.4;
}
body.auth-body::before {
    width: 500px; height: 500px;
    top: -10%; right: -5%;
    background: radial-gradient(circle, rgba(168,85,247,0.25), transparent 70%);
    animation: bgFloat1 12s ease-in-out infinite alternate;
}
body.auth-body::after {
    width: 400px; height: 400px;
    bottom: -10%; left: -5%;
    background: radial-gradient(circle, rgba(236,72,153,0.2), transparent 70%);
    animation: bgFloat2 15s ease-in-out infinite alternate;
}
@keyframes bgFloat1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-40px, 30px) scale(1.1); }
}
@keyframes bgFloat2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -20px) scale(1.15); }
}

/* ── Flash Messages ────────────────────────────────── */
.flash-wrapper {
    position: fixed; top: 1.5rem; right: 1.5rem;
    z-index: 9999; max-width: 400px; width: 100%;
}
.alert {
    padding: 0.85rem 1.2rem; border-radius: 14px;
    font-size: 0.88rem; font-weight: 500;
    margin-bottom: 0.5rem;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    animation: alertSlide 0.5s cubic-bezier(0.34,1.56,0.64,1);
    backdrop-filter: blur(16px);
}
.alert-success { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.25); color: #065f46; }
.alert-error   { background: rgba(239,68,68,0.12);  border: 1px solid rgba(239,68,68,0.25);  color: #991b1b; }
.alert-info    { background: rgba(59,130,246,0.12);  border: 1px solid rgba(59,130,246,0.25); color: #1e40af; }
@keyframes alertSlide {
    from { transform: translateX(120%) scale(0.8); opacity: 0; }
    to   { transform: translateX(0) scale(1); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════
   AUTH CARD — Main Container
   ═══════════════════════════════════════════════════════ */
.auth-card-wrapper {
    display: flex;
    width: 100%; max-width: 920px;
    min-height: 580px;
    background: #fff;
    border-radius: 28px;
    overflow: hidden;
    box-shadow:
        0 30px 80px rgba(0,0,0,0.07),
        0 4px 20px rgba(0,0,0,0.03),
        0 0 0 1px rgba(0,0,0,0.02);
    position: relative; z-index: 1;
    animation: cardEntrance 0.7s cubic-bezier(0.22,1,0.36,1);
}
@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════════════════
   LEFT PANEL — Gradient Brand
   ═══════════════════════════════════════════════════════ */
.auth-left {
    flex: 0 0 42%;
    background: linear-gradient(160deg, #7c3aed 0%, #a855f7 25%, #ec4899 60%, #f472b6 100%);
    padding: 2.5rem 2rem;
    display: flex; flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    color: #fff;
}

/* Decorative orbs */
.auth-left::before {
    content: '';
    position: absolute; top: -60px; right: -40px;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    animation: orbPulse 6s ease-in-out infinite;
}
.auth-left::after {
    content: '';
    position: absolute; top: -20px; right: 20px;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    animation: orbPulse 8s ease-in-out 1s infinite;
}
@keyframes orbPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
}

/* Brand content */
.auth-left-content {
    position: relative; z-index: 2;
    flex: 1; display: flex; flex-direction: column;
    justify-content: center;
}
.auth-left-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.85rem; font-weight: 700;
    line-height: 1.3; margin-bottom: 0.75rem;
    animation: fadeUp 0.6s 0.2s both;
}
.auth-left-content h2 .brand-highlight { display: block; }
.auth-left-content > p {
    font-size: 0.9rem; line-height: 1.7;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2rem; max-width: 280px;
    animation: fadeUp 0.6s 0.3s both;
}

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

/* Feature list */
.auth-features { padding: 0; display: flex; flex-direction: column; gap: 0.85rem; }
.auth-features li {
    display: flex; align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem; font-weight: 500;
    color: rgba(255,255,255,0.95);
    animation: fadeUp 0.5s both;
    transition: transform 0.3s ease;
}
.auth-features li:nth-child(1) { animation-delay: 0.35s; }
.auth-features li:nth-child(2) { animation-delay: 0.45s; }
.auth-features li:nth-child(3) { animation-delay: 0.55s; }
.auth-features li:nth-child(4) { animation-delay: 0.65s; }
.auth-features li:hover { transform: translateX(6px); }

.feature-icon-box {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.auth-features li:hover .feature-icon-box { transform: scale(1.15) rotate(-5deg); }

.feature-icon-box.purple { background: rgba(139,92,246,0.5); }
.feature-icon-box.green  { background: rgba(16,185,129,0.5); }
.feature-icon-box.pink   { background: rgba(244,114,182,0.5); }
.feature-icon-box.blue   { background: rgba(96,165,250,0.5); }

/* Stats row */
.auth-stats {
    display: flex; gap: 1.75rem;
    position: relative; z-index: 2;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: 1.5rem;
    animation: fadeUp 0.6s 0.75s both;
}
.auth-stat { text-align: left; }
.auth-stat .stat-val {
    font-size: 1.5rem; font-weight: 800;
    display: block; line-height: 1.2;
}
.auth-stat .stat-lbl {
    font-size: 0.72rem; font-weight: 500;
    color: rgba(255,255,255,0.65);
    text-transform: uppercase; letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════
   RIGHT PANEL — Form Area
   ═══════════════════════════════════════════════════════ */
.auth-right {
    flex: 1;
    padding: 2.5rem;
    display: flex; flex-direction: column;
    justify-content: center;
    animation: fadeUp 0.6s 0.15s both;
}

/* ── Tab Switcher ──────────────────────────────────── */
.auth-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 2rem;
    position: relative;
}
.auth-tab {
    flex: 1; padding: 0.7rem 1rem;
    text-align: center;
    font-size: 0.9rem; font-weight: 600;
    color: #94a3b8;
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    border: none; background: none;
    font-family: inherit;
    display: block; line-height: 1.4;
    position: relative; z-index: 1;
}
.auth-tab.active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
    font-weight: 700;
}
.auth-tab:hover:not(.active) {
    color: #475569;
    background: rgba(255,255,255,0.5);
}

/* ── Form Header ───────────────────────────────────── */
.auth-form-header { margin-bottom: 1.5rem; }
.auth-form-header h1 {
    font-size: 1.5rem; font-weight: 800;
    color: #0f172a; margin-bottom: 0.3rem;
    letter-spacing: -0.3px;
}
.auth-form-header p {
    font-size: 0.9rem; color: #64748b; line-height: 1.5;
}

/* ── Form Controls ─────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: block; font-size: 0.82rem;
    font-weight: 600; color: #334155;
    margin-bottom: 0.4rem;
    transition: color 0.2s;
}
.form-group:focus-within label {
    color: #7c3aed;
}
.form-group label .req { color: #ec4899; }

/* Input wrapper with icon */
.input-wrapper { position: relative; }
.input-wrapper .input-icon {
    position: absolute; left: 0.9rem; top: 50%;
    transform: translateY(-50%);
    font-size: 0.92rem; color: #b0b8c8;
    pointer-events: none; line-height: 1;
    transition: all 0.3s ease;
}
.form-group:focus-within .input-icon {
    color: #7c3aed;
    transform: translateY(-50%) scale(1.1);
}
.input-wrapper .form-control { padding-left: 2.6rem; }

/* Base input */
.form-control {
    width: 100%; padding: 0.8rem 1rem;
    font-size: 0.92rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    color: #0f172a;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.form-control:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}
.form-control:focus {
    border-color: #a78bfa;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(167,139,250,0.1), 0 2px 8px rgba(0,0,0,0.04);
}
.form-control::placeholder { color: #a0aec0; }
.form-control.error {
    border-color: #f87171;
    box-shadow: 0 0 0 4px rgba(248,113,113,0.1);
    animation: inputShake 0.4s ease;
}
@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* Field errors */
.field-error {
    font-size: 0.75rem; color: #ef4444;
    margin-top: 0.25rem; display: none; font-weight: 500;
    animation: fadeUp 0.3s ease;
}
.field-error.show { display: block; }

/* ── Password Toggle ───────────────────────────────── */
.password-wrapper { position: relative; }
.password-wrapper .form-control { padding-right: 2.8rem; }
.toggle-password {
    position: absolute; right: 0.75rem; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: #94a3b8; font-size: 1rem;
    cursor: pointer; padding: 2px;
    line-height: 1;
    transition: all 0.25s ease;
}
.toggle-password:hover {
    color: #7c3aed;
    transform: translateY(-50%) scale(1.15);
}

/* ── Form Extras Row ───────────────────────────────── */
.form-extras {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 1.35rem;
    font-size: 0.82rem;
}
.form-extras label {
    display: flex; align-items: center; gap: 0.4rem;
    color: #475569; cursor: pointer; font-weight: 500;
    transition: color 0.2s;
}
.form-extras label:hover { color: #1e293b; }
.form-extras label input[type="checkbox"] {
    accent-color: #a855f7; width: 16px; height: 16px;
    cursor: pointer;
}
.form-extras a {
    color: #a855f7; font-weight: 600;
    transition: all 0.2s;
    position: relative;
}
.form-extras a::after {
    content: '';
    position: absolute; bottom: -2px; left: 0;
    width: 0; height: 1.5px;
    background: #7c3aed;
    transition: width 0.3s ease;
}
.form-extras a:hover { color: #7c3aed; }
.form-extras a:hover::after { width: 100%; }

/* ── Submit Button ─────────────────────────────────── */
.btn-auth {
    width: 100%; padding: 0.9rem;
    font-size: 0.95rem; font-weight: 700;
    color: #fff; border: none; border-radius: 12px;
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #f472b6 100%);
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    box-shadow: 0 6px 20px rgba(168,85,247,0.3);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    font-family: 'Plus Jakarta Sans', sans-serif;
    position: relative; overflow: hidden;
}
.btn-auth::before {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}
.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(168,85,247,0.4);
}
.btn-auth:hover::before { left: 100%; }
.btn-auth:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 12px rgba(168,85,247,0.3);
}
@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Loading state */
.btn-auth.loading {
    pointer-events: none; opacity: 0.85;
    color: transparent;
}
.btn-auth.loading::after {
    content: '';
    position: absolute; top: 50%; left: 50%;
    width: 22px; height: 22px;
    margin: -11px 0 0 -11px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.7s linear infinite;
}
@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* ── Divider ───────────────────────────────────────── */
.auth-divider {
    display: flex; align-items: center;
    margin: 1.35rem 0; gap: 0.75rem;
    color: #94a3b8; font-size: 0.78rem;
    font-weight: 500;
}
.auth-divider::before,
.auth-divider::after {
    content: ''; flex: 1;
    border-top: 1px solid #e2e8f0;
}

/* ── Social Buttons ────────────────────────────────── */
.social-buttons { display: flex; gap: 0.75rem; }
.btn-social {
    flex: 1; display: flex;
    align-items: center; justify-content: center;
    gap: 0.5rem;
    padding: 0.72rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    font-size: 0.88rem; font-weight: 600;
    color: #334155;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    position: relative; overflow: hidden;
}
.btn-social::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(168,85,247,0.04), rgba(236,72,153,0.04));
    opacity: 0; transition: opacity 0.3s;
}
.btn-social:hover {
    border-color: #c4b5fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.btn-social:hover::before { opacity: 1; }
.btn-social:active { transform: translateY(0) scale(0.97); }
.btn-social svg { width: 18px; height: 18px; flex-shrink: 0; position: relative; z-index: 1; }

/* ── Auth Footer ───────────────────────────────────── */
.auth-footer {
    text-align: center; margin-top: 1.5rem;
    font-size: 0.88rem; color: #64748b;
}
.auth-footer a {
    color: #a855f7; font-weight: 700;
    position: relative;
    transition: color 0.2s;
}
.auth-footer a::after {
    content: '';
    position: absolute; bottom: -2px; left: 0;
    width: 0; height: 2px;
    background: linear-gradient(90deg, #a855f7, #ec4899);
    transition: width 0.3s ease;
    border-radius: 1px;
}
.auth-footer a:hover { color: #7c3aed; }
.auth-footer a:hover::after { width: 100%; }

/* ── Server Errors ─────────────────────────────────── */
.auth-errors {
    background: linear-gradient(135deg, rgba(239,68,68,0.06), rgba(239,68,68,0.03));
    border: 1px solid rgba(239,68,68,0.15);
    border-radius: 12px; padding: 0.8rem 1rem;
    margin-bottom: 1.25rem; font-size: 0.82rem; color: #b91c1c;
    animation: fadeUp 0.4s ease;
}
.auth-errors div { padding: 0.12rem 0; }
.auth-success {
    background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(16,185,129,0.04));
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 12px; padding: 0.8rem 1rem;
    margin-bottom: 1.25rem; font-size: 0.82rem; color: #047857;
    animation: fadeUp 0.4s ease;
}
.auth-success div { padding: 0.12rem 0; }

/* ═══════════════════════════════════════════════════════
   FORM LAYOUT — Rows, Sections, Select, Date
   ═══════════════════════════════════════════════════════ */

/* Two-column rows */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Section divider labels */
.form-section-label {
    font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: #a855f7;
    margin: 1.25rem 0 0.7rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #f3e8ff;
    display: flex; align-items: center; gap: 0.5rem;
}
.form-section-label:first-of-type { margin-top: 0; }

/* Custom select */
select.form-control {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}
select.form-control:invalid,
select.form-control option[value=""] { color: #a0aec0; }
select.form-control option { color: #0f172a; }

/* Register card overrides */
.register-card { max-width: 1020px; }
.register-card .auth-right {
    justify-content: flex-start;
    overflow-y: auto;
    max-height: 100vh;
    padding: 2rem 2.25rem;
}
.register-card .auth-tabs {
    position: static;
    background: #f1f5f9;
}

/* Date input */
input[type="date"].form-control { color: #0f172a; cursor: pointer; }
input[type="date"].form-control::-webkit-calendar-picker-indicator {
    opacity: 0.4; cursor: pointer;
    transition: opacity 0.2s;
}
input[type="date"].form-control:hover::-webkit-calendar-picker-indicator { opacity: 0.7; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    body.auth-body {
        padding: 0.75rem;
        align-items: flex-start;
        padding-top: 1rem;
    }
    body.auth-body.has-navbar { padding: 0; }
    .auth-page-shell {
        min-height: calc(100vh - 80px);
        padding: 1.25rem 0.75rem;
        align-items: flex-start;
    }
    .auth-card-wrapper {
        flex-direction: column;
        border-radius: 22px;
        min-height: auto;
    }
    .auth-left { flex: none; padding: 2rem 1.5rem 1.5rem; }
    .auth-left-content h2 { font-size: 1.4rem; }
    .auth-left-content > p { display: none; }
    .auth-features { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
    .auth-features li { font-size: 0.76rem; gap: 0.35rem; }
    .feature-icon-box { width: 26px; height: 26px; font-size: 0.72rem; }
    .auth-stats { gap: 1.25rem; }
    .auth-stat .stat-val { font-size: 1.15rem; }
    .auth-right { padding: 1.5rem 1.25rem; }
    .auth-form-header h1 { font-size: 1.3rem; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .register-card .auth-right { max-height: none; padding: 1.5rem 1.25rem; }
    .register-card .auth-tabs { margin: -0.25rem 0 1.5rem; }
}

@media (max-width: 480px) {
    body.auth-body { padding: 0.5rem; padding-top: 0.5rem; }
    body.auth-body.has-navbar { padding: 0; }
    .auth-left { padding: 1.5rem 1.25rem 1.25rem; }
    .auth-left-content h2 { font-size: 1.15rem; }
    .auth-features { display: none; }
    .auth-stats { gap: 1rem; }
    .auth-stat .stat-val { font-size: 1rem; }
    .auth-right { padding: 1.25rem 1rem; }
    .social-buttons { flex-direction: column; }
    .auth-form-header h1 { font-size: 1.2rem; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .btn-auth { padding: 0.85rem; font-size: 0.9rem; }
}

/* ═══════════════════════════════════════════════════════
   FOCUS VISIBLE (Accessibility)
   ═══════════════════════════════════════════════════════ */
.auth-tab:focus-visible,
.btn-auth:focus-visible,
.btn-social:focus-visible {
    outline: 2px solid #a855f7;
    outline-offset: 2px;
}
.form-control:focus-visible {
    outline: none; /* Custom focus styling handled above */
}
