/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; outline: none; color: inherit; }
ul { list-style: none; }
input, textarea, select { font: inherit; color: inherit; }

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ===== Layout ===== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.section {
    padding: var(--space-9) 0;
    position: relative;
}

.section-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto var(--space-8);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-primary-alt);
    background: rgba(255, 207, 64, 0.12);
    border: 1px solid rgba(255, 207, 64, 0.25);
    padding: var(--space-1) var(--space-4);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-4);
}

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: var(--fs-5xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
p { color: var(--color-text-muted); }

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }

/* ===== Background: animated mesh + noise ===== */
.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: var(--color-bg);
    background-image: var(--gradient-mesh);
    background-attachment: fixed;
}
.bg-noise {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.035;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.blob-field {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
}
.blob--1 { width: 420px; height: 420px; top: -120px; left: -100px; background: radial-gradient(circle, rgba(245,180,0,0.32), transparent 65%); }
.blob--2 { width: 480px; height: 480px; top: 20%; right: -180px; background: radial-gradient(circle, rgba(47,111,209,0.18), transparent 65%); animation-delay: 2s; }
.blob--3 { width: 380px; height: 380px; bottom: -140px; left: 30%; background: radial-gradient(circle, rgba(255,207,64,0.26), transparent 65%); animation-delay: 4s; }
[data-theme="light"] .blob--1 { background: radial-gradient(circle, rgba(245,180,0,0.18), transparent 65%); }
[data-theme="light"] .blob--2 { background: radial-gradient(circle, rgba(47,111,209,0.1), transparent 65%); }
[data-theme="light"] .blob--3 { background: radial-gradient(circle, rgba(255,207,64,0.14), transparent 65%); }

/* ===== Glass surfaces ===== */
.glass {
    background: var(--color-surface);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.glass-card {
    background: var(--color-surface);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: var(--fs-sm);
    border: 1px solid transparent;
    transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
    white-space: nowrap;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
    background: var(--gradient-brand);
    background-size: 160% 160%;
    color: var(--color-on-primary);
    box-shadow: 0 8px 24px rgba(245, 180, 0, 0.35);
}
.btn-primary:hover {
    box-shadow: 0 10px 34px rgba(245, 180, 0, 0.5);
    background-position: 100% 0;
    transform: translateY(-2px);
}

.btn-ghost {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
    backdrop-filter: var(--blur-sm);
}
.btn-ghost:hover {
    border-color: var(--color-border-strong);
    background: var(--color-surface-strong);
    transform: translateY(-2px);
}

.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--fs-xs); }
.btn-lg { padding: var(--space-4) var(--space-7); font-size: var(--fs-base); }
.btn-block { width: 100%; }

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: var(--space-4) 0;
    transition: background var(--dur-base) var(--ease-out), backdrop-filter var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), padding var(--dur-base) var(--ease-out);
    border-bottom: 1px solid transparent;
}
.navbar.is-scrolled {
    background: rgba(11, 10, 6, 0.72);
    backdrop-filter: var(--blur-lg);
    -webkit-backdrop-filter: var(--blur-lg);
    border-bottom-color: var(--color-border);
    padding: var(--space-3) 0;
}
[data-theme="light"] .navbar.is-scrolled { background: rgba(255, 253, 246, 0.75); }

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 800;
    font-size: var(--fs-lg);
    letter-spacing: -0.02em;
}
.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: contain;
    padding: 2px;
    box-shadow: 0 4px 16px rgba(245, 180, 0, 0.35);
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}
.nav-links a {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    position: relative;
    padding: var(--space-1) 0;
    transition: color var(--dur-fast) var(--ease-out);
}
.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: var(--gradient-brand);
    transition: width var(--dur-base) var(--ease-out);
    border-radius: var(--radius-full);
}
.nav-links a:hover { color: var(--color-text); }
.nav-links a:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: var(--space-3); }

.theme-toggle {
    position: relative;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    transition: transform var(--dur-fast) var(--ease-spring), border-color var(--dur-base);
}
.theme-toggle:hover { transform: translateY(-2px) rotate(-8deg); border-color: var(--color-border-strong); }
.theme-toggle svg { position: absolute; transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-spring); }
.theme-toggle .icon-moon { opacity: 0; transform: scale(0.5) rotate(30deg); }
.theme-toggle .icon-sun { opacity: 1; transform: scale(1) rotate(0); }
[data-theme="light"] .theme-toggle .icon-sun { opacity: 0; transform: scale(0.5) rotate(-30deg); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 1; transform: scale(1) rotate(0); }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-2);
    color: var(--color-text);
}

.mobile-drawer {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height var(--dur-slow) var(--ease-out), opacity var(--dur-base) var(--ease-out), padding var(--dur-base);
    padding: 0 var(--space-5);
}
.mobile-drawer.is-open {
    max-height: 480px;
    opacity: 1;
    padding: var(--space-5);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-3);
}
.mobile-drawer a { font-size: var(--fs-base); font-weight: 500; color: var(--color-text-muted); }

/* ===== Footer ===== */
.footer {
    padding: var(--space-9) 0 var(--space-6);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-9);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr repeat(3, 1fr);
    gap: var(--space-7);
    margin-bottom: var(--space-8);
}
.footer-col h4 {
    font-size: var(--fs-sm);
    margin-bottom: var(--space-4);
    color: var(--color-text);
}
.footer-col ul { display: flex; flex-direction: column; gap: var(--space-3); }
.footer-col a { color: var(--color-text-muted); font-size: var(--fs-sm); transition: color var(--dur-fast); }
.footer-col a:hover { color: var(--color-text); }

.newsletter-form {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-4);
}
.newsletter-form input {
    flex: 1;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    padding: var(--space-2) var(--space-4);
    color: var(--color-text);
    font-size: var(--fs-sm);
}
.newsletter-form input:focus { outline: none; border-color: var(--color-primary-alt); }

.social-links { display: flex; gap: var(--space-3); margin-top: var(--space-5); }
.social-links a {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    transition: transform var(--dur-fast) var(--ease-spring), border-color var(--dur-base);
}
.social-links a:hover { transform: translateY(-3px); border-color: var(--color-border-strong); }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-5);
    border-top: 1px solid var(--color-border);
    font-size: var(--fs-xs);
    color: var(--color-text-faint);
}

/* ===== Modals ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: var(--blur-sm);
}
.modal-overlay.is-open { display: flex; animation: fadeIn 0.25s var(--ease-out); }
.modal { width: 100%; max-width: 480px; padding: 0; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-5); border-bottom: 1px solid var(--color-border); }
.modal-head h3 { font-size: var(--fs-lg); }
.modal-close { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--color-text-faint); background: var(--color-surface); }
.modal-close:hover { color: var(--color-text); }
.modal-body { padding: var(--space-5); max-height: 60vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--space-3); padding: var(--space-5); border-top: 1px solid var(--color-border); }

/* ===== Toast notifications ===== */
.toast-stack {
    position: fixed;
    bottom: var(--space-5);
    right: var(--space-5);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    min-width: 280px;
    max-width: 360px;
    animation: slideLeft 0.35s var(--ease-spring) both;
}
.toast svg { flex-shrink: 0; }
.toast.success { color: var(--color-accent-alt); }
.toast.error { color: var(--color-danger); }
.toast.info { color: var(--color-accent); }
.toast .toast-msg { font-size: var(--fs-sm); color: var(--color-text); }

/* ===== Tabs ===== */
.tabs { display: flex; gap: var(--space-2); border-bottom: 1px solid var(--color-border); margin-bottom: var(--space-6); overflow-x: auto; }
.tab-btn {
    background: none;
    border: none;
    outline: none;
    padding: var(--space-3) var(--space-4);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--color-text-faint);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color var(--dur-fast), border-color var(--dur-fast);
}
.tab-btn:hover { color: var(--color-text); }
.tab-btn.is-active { color: var(--color-text); border-color: var(--color-primary-alt); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fadeIn 0.35s var(--ease-out); }

/* ===== Badges ===== */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 700; padding: 3px 10px; border-radius: var(--radius-full); }
.badge-primary { background: rgba(47, 111, 209, 0.12); color: #2f6fd1; }
.badge-success { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.badge-danger { background: rgba(244, 63, 94, 0.12); color: #c81e45; }

/* ===== Chips ===== */
.chip-grid { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-5); }
.chip {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-spring);
}
.chip:hover { border-color: var(--color-border-strong); transform: translateY(-2px); }
.chip.is-selected { background: var(--gradient-brand); border-color: transparent; color: var(--color-on-primary); }

/* ===== Float card (icon + title/desc row) ===== */
.float-card {
    padding: var(--space-4) var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 200px;
}
.float-card .icon-badge {
    width: 38px; height: 38px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    background: var(--gradient-brand);
    color: var(--color-on-primary);
    flex-shrink: 0;
}
.float-card .title { font-size: var(--fs-sm); font-weight: 700; }
.float-card .desc { font-size: var(--fs-xs); color: var(--color-text-faint); }

/* ===== Avatar circle (initials) ===== */
.avatar-circle {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--gradient-brand);
    display: flex; align-items: center; justify-content: center;
    color: var(--color-on-primary); font-weight: 700; font-size: var(--fs-sm);
    flex-shrink: 0;
}

/* ===== Form fields (shared across auth, dashboard, employer, admin) ===== */
.form-group { position: relative; margin-bottom: var(--space-5); }
.form-label {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}
.input-wrap { position: relative; }
.input-wrap svg.field-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-faint);
    pointer-events: none;
    transition: color var(--dur-base) var(--ease-out);
}
.form-control {
    width: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    font-size: var(--fs-sm);
    color: var(--color-text);
    transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background var(--dur-base);
}
.input-wrap .form-control { padding-left: var(--space-9); }
.form-control:focus {
    outline: none;
    border-color: var(--color-primary-alt);
    box-shadow: 0 0 0 4px rgba(255, 207, 64, 0.15);
    background: var(--color-surface-strong);
}
.form-control:focus ~ svg.field-icon,
.input-wrap:has(.form-control:focus) svg.field-icon { color: var(--color-primary-alt); }
.form-control.has-error { border-color: var(--color-danger); }
.field-error {
    font-size: var(--fs-xs);
    color: var(--color-danger);
    margin-top: var(--space-2);
    display: none;
}
.field-error.is-visible { display: block; animation: slideDown 0.3s var(--ease-out); }

.field-toggle {
    position: absolute;
    right: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-faint);
    display: flex;
}
.field-toggle:hover { color: var(--color-text); }

/* Password strength meter */
.pw-strength { display: flex; gap: 5px; margin-top: var(--space-3); }
.pw-strength span { height: 4px; flex: 1; border-radius: var(--radius-full); background: var(--color-border); transition: background var(--dur-base) var(--ease-out); }
.pw-strength.level-1 span:nth-child(1) { background: var(--color-danger); }
.pw-strength.level-2 span:nth-child(-n+2) { background: var(--color-warn); }
.pw-strength.level-3 span:nth-child(-n+3) { background: var(--color-accent); }
.pw-strength.level-4 span { background: var(--color-accent-alt); }
.pw-strength-label { font-size: var(--fs-xs); color: var(--color-text-faint); margin-top: var(--space-2); }

/* Row helpers */
.form-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-5); font-size: var(--fs-sm); }
.checkbox-label { display: flex; align-items: flex-start; gap: var(--space-2); color: var(--color-text-muted); cursor: pointer; font-size: var(--fs-sm); line-height: 1.5; }
.checkbox-label input { accent-color: var(--color-primary-alt); width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.link-muted { color: var(--color-primary-alt); font-weight: 500; }
.link-muted:hover { text-decoration: underline; }

/* ===== Feature icon badge ===== */
.feature-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: var(--color-surface-strong);
    border: 1px solid var(--color-border);
    color: var(--color-primary-alt);
    margin-bottom: var(--space-4);
}

/* ===== Social auth buttons ===== */
.btn-social {
    display: flex; align-items: center; justify-content: center; gap: var(--space-3);
    width: 100%; padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    font-weight: 600; font-size: var(--fs-sm);
    color: var(--color-text);
    transition: transform var(--dur-fast) var(--ease-spring), border-color var(--dur-base), background var(--dur-base);
}
.btn-social:hover { transform: translateY(-2px); border-color: var(--color-border-strong); background: var(--color-surface-strong); }

/* ===== Email connection page ===== */
.email-status-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}
.email-status-icon {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(245, 158, 11, 0.12);
    color: var(--color-warn);
    flex-shrink: 0;
}
.email-status-icon.is-connected { background: rgba(22, 163, 74, 0.12); color: #15803d; }
.email-status-text { flex: 1; min-width: 0; }
.email-status-title { font-weight: 700; font-size: var(--fs-base); }
.email-status-desc { font-size: var(--fs-sm); color: var(--color-text-muted); margin-top: 2px; }

.email-options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: start; }
.email-option-card { position: relative; }
.email-option-badge {
    position: absolute;
    top: var(--space-5); right: var(--space-5);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--color-accent-alt);
    background: rgba(22, 163, 74, 0.1);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}
.email-connected-pill {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: rgba(22, 163, 74, 0.1);
    color: #15803d;
    font-size: var(--fs-sm);
    font-weight: 600;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}

@media (max-width: 900px) {
    .email-options-grid { grid-template-columns: 1fr; }
}

/* ===== Progress bars ===== */
.progress-bar { height: 8px; border-radius: var(--radius-full); background: var(--color-surface-strong); overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: var(--radius-full); background: var(--gradient-brand); transition: width 0.6s var(--ease-out); }

/* ===== Empty states ===== */
.empty-state { text-align: center; padding: var(--space-9) var(--space-5); }
.empty-state svg { color: var(--color-text-faint); margin: 0 auto var(--space-4); }
.empty-state h3 { font-size: var(--fs-lg); margin-bottom: var(--space-2); }
.empty-state p { font-size: var(--fs-sm); margin-bottom: var(--space-5); }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: var(--radius-full); }

/* ===== Responsive ===== */
@media (max-width: 960px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .nav-links { display: none; }
    .nav-toggle { display: inline-flex; }
    h1 { font-size: var(--fs-4xl); }
}
@media (max-width: 560px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: var(--space-3); text-align: center; }
    h1 { font-size: var(--fs-3xl); }
}
