/* ============ DESIGN TOKENS ============ */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-soft: #eef2ff;
    --accent: #8b5cf6;
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --gradient-soft: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);

    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #e2e8f0;

    --surface: #ffffff;
    --surface-2: #f8fafc;
    --bg: #f1f5f9;

    --success-bg: #dcfce7;
    --success-fg: #15803d;

    --radius: 18px;
    --radius-sm: 12px;
    --radius-xs: 9px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
    --shadow-lg: 0 24px 50px -20px rgba(79, 70, 229, 0.35);

    --ring: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink);
    background-color: var(--bg);
    background-image:
        radial-gradient(60rem 40rem at 110% -10%, rgba(139, 92, 246, 0.18), transparent 60%),
        radial-gradient(50rem 35rem at -10% 0%, rgba(99, 102, 241, 0.16), transparent 55%);
    background-attachment: fixed;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    letter-spacing: -0.02em;
    color: var(--ink);
    line-height: 1.2;
}

/* ============ NAVIGATION ============ */
.navbar {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 2rem;
}

.logo {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.03em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.logo-mark { filter: drop-shadow(0 2px 6px rgba(99, 102, 241, 0.4)); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--ink-2);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-dark);
    background: var(--primary-soft);
}

.nav-cta {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 6px 16px -6px rgba(99, 102, 241, 0.6);
}

.nav-cta:hover {
    color: #fff;
    filter: brightness(1.05);
    transform: translateY(-1px);
}

/* ============ SECTIONS ============ */
.section {
    display: none;
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 2.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: fadeUp 0.45s ease;
}

.section.active { display: block; }

/* Bare sections render their own inner cards */
.section--bare {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 2.5rem 2rem;
}

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

/* ============ HERO ============ */
.hero {
    text-align: center;
    padding: 3.5rem 2rem 3rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(40rem 20rem at 50% -20%, rgba(139, 92, 246, 0.12), transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-block;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 620px;
    margin: 0 auto 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 1.75rem;
    padding: 1rem 1.75rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.stat { display: flex; flex-direction: column; }
.stat-num {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--ink);
}
.stat-label { font-size: 0.8rem; color: var(--muted); }
.stat-divider { width: 1px; height: 34px; background: var(--line); }

/* Feature cards */
.features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1.6rem;
    text-align: left;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    background: var(--gradient-soft);
    border-radius: 14px;
    margin-bottom: 1rem;
}

.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.feature-card p { color: var(--muted); font-size: 0.92rem; }

/* ============ BUTTONS ============ */
.btn {
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 10px 24px -10px rgba(99, 102, 241, 0.7);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.04);
}

.btn-secondary {
    background: var(--surface);
    color: var(--ink-2);
    border: 1px solid var(--line);
}

.btn-secondary:hover {
    background: var(--surface-2);
    border-color: #cbd5e1;
}

.btn-ghost {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.btn-ghost:hover {
    background: #e0e7ff;
    transform: translateY(-2px);
}

.btn-lg { padding: 0.9rem 1.8rem; font-size: 1.02rem; }

.btn-block { width: 100%; margin-bottom: 0.75rem; }

/* ============ AUTH ============ */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 1rem;
}

.auth-box {
    background: var(--surface);
    padding: 2.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 440px;
}

.auth-head { text-align: center; margin-bottom: 1.75rem; }
.auth-box h2 { margin-bottom: 0.4rem; }
.auth-sub { color: var(--muted); font-size: 0.95rem; }

.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.role-btn {
    padding: 0.7rem 0.4rem;
    border: 1.5px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-2);
    transition: all 0.2s ease;
}

.role-btn:hover { border-color: var(--primary); color: var(--primary-dark); }

.role-btn.active {
    background: var(--gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 18px -8px rgba(99, 102, 241, 0.7);
}

.field { margin-bottom: 1.1rem; }
.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 0.4rem;
}

#authForm input,
#authForm select {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-xs);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--ink);
    background: var(--surface-2);
    transition: all 0.2s ease;
}

#authForm input:focus,
#authForm select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: var(--ring);
}

.toggle-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 1.1rem;
}

/* ============ JOBS ============ */
.jobs-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

.filters-panel {
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    height: fit-content;
    position: sticky;
    top: 90px;
}

.filters-panel h3 { margin-bottom: 1.4rem; font-size: 1.05rem; }

.filter-group { margin-bottom: 1.2rem; }

.filter-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--ink-2);
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-xs);
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--surface);
    transition: all 0.2s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
}

.filters-panel .btn-block:first-of-type { margin-top: 0.5rem; }

.jobs-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.jobs-list h2 { font-size: 1.5rem; }

.results-container { display: grid; gap: 1rem; }

.job-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
}

.job-card::before {
    content: "";
    position: absolute;
    left: 0; top: 14px; bottom: 14px;
    width: 3px;
    border-radius: 3px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.job-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.35);
}

.job-card:hover::before { opacity: 1; }

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.4rem;
}

.job-title { font-size: 1.2rem; font-weight: 700; color: var(--ink); }

.job-salary {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
    white-space: nowrap;
    background: var(--primary-soft);
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
}

.job-company { color: var(--muted); font-size: 0.92rem; margin-bottom: 0.6rem; }

.job-meta {
    display: flex;
    gap: 0.5rem;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}

.job-badge {
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink-2);
}

.job-badge.remote {
    background: var(--success-bg);
    color: var(--success-fg);
    border-color: transparent;
}

.job-description {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-top: 0.6rem;
}

.loading {
    text-align: center;
    color: var(--muted);
    padding: 3rem;
    background: var(--surface-2);
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
}

/* ============ MODAL ============ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    padding: 1rem;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeUp 0.25s ease;
}

.modal-content {
    background: var(--surface);
    padding: 2.25rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 620px;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-content h2 { margin-bottom: 0.25rem; }
.modal-content h3 { margin: 1.4rem 0 0.6rem; font-size: 1.05rem; }

.job-link {
    text-decoration: none;
    margin-top: 1rem;
    width: 100%;
}

.close {
    position: absolute;
    right: 1.2rem;
    top: 1rem;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close:hover { color: var(--ink); background: var(--surface-2); }

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

/* ============ PROFILE ============ */
.profile-container { max-width: 680px; margin: 0 auto; }
.profile-container > h2 { margin-bottom: 1.5rem; }

.profile-card {
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 1.6rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
}

.profile-card h3 { margin-bottom: 1rem; font-size: 1.1rem; }
.profile-info { display: grid; gap: 0.6rem; }
.profile-info p { color: var(--ink-2); }
.profile-info strong { color: var(--ink); font-weight: 600; }
.profile-info a { color: var(--primary-dark); }

/* ============ ADMIN ============ */
.admin-container { max-width: 840px; margin: 0 auto; }
.admin-container > h2 { margin-bottom: 1.5rem; }

.admin-section {
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 1.6rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.admin-section h3 { margin-bottom: 1.1rem; font-size: 1.1rem; }

.admin-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.config-group { margin-bottom: 1.1rem; }
.config-group label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--ink-2);
}

.config-group input,
.config-group select {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-xs);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--surface);
    margin-bottom: 0.6rem;
    transition: all 0.2s ease;
}

.config-group input:focus,
.config-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
}

#usersList {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-xs);
    margin-bottom: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.user-item {
    padding: 0.85rem 0.25rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-item:last-child { border-bottom: none; }

/* ============ FOOTER ============ */
footer {
    text-align: center;
    padding: 2.5rem 2rem;
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 3rem;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.5);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .features { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .nav-container { padding: 0.8rem 1.2rem; }
    .nav-links { gap: 0.25rem; }
    .nav-link { padding: 0.45rem 0.6rem; font-size: 0.88rem; }

    .section, .section--bare { margin: 1.5rem auto; padding: 1.5rem; }

    .jobs-container { grid-template-columns: 1fr; }
    .filters-panel { position: static; }

    .features { grid-template-columns: 1fr; }

    .hero-stats { gap: 1.1rem; padding: 0.85rem 1.1rem; }
    .stat-num { font-size: 1.3rem; }

    .role-selector { grid-template-columns: 1fr; }

    .modal-content { padding: 1.5rem; }
}

@media (max-width: 480px) {
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }
}
