/* ═══════════════════════════════════════════════════════
   AfterTaxCalculator.co.uk — Design System
   Unique identity: Indigo + Coral, DM Sans type, 
   gradient accents, rounded modern UI
   ═══════════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
    --brand-primary: #6366f1;
    --brand-primary-dark: #4f46e5;
    --brand-primary-light: #a5b4fc;
    --brand-accent: #f43f5e;
    --brand-accent-light: #fda4af;
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --brand-gradient-accent: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%);
    --brand-gradient-subtle: linear-gradient(135deg, #eef2ff 0%, #fce7f3 100%);
    --bg-body: #f8f9fc;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --bg-input: #f1f3f9;
    --border: #e2e5ef;
    --border-focus: #6366f1;
    --text-primary: #1e1b4b;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-on-brand: #ffffff;
    --shadow-sm: 0 1px 3px rgba(99, 102, 241, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --shadow-md: 0 4px 16px rgba(99, 102, 241, .08), 0 2px 4px rgba(0, 0, 0, .04);
    --shadow-lg: 0 12px 40px rgba(99, 102, 241, .12), 0 4px 8px rgba(0, 0, 0, .04);
    --shadow-glow: 0 0 24px rgba(99, 102, 241, .2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 50px;
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --transition: .2s cubic-bezier(.4, 0, .2, 1);
    --container: 1120px;
    --net-color: #6366f1;
    --tax-color: #f43f5e;
    --ni-color: #06b6d4;
    --student-color: #f59e0b;
}

[data-theme="dark"] {
    --bg-body: #0c0a1d;
    --bg-card: #1a1735;
    --bg-elevated: #221f3d;
    --bg-input: #2a2650;
    --border: #312d56;
    --border-focus: #818cf8;
    --text-primary: #eef2ff;
    --text-secondary: #c7d2fe;
    --text-muted: #7c7aad;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .4);
    --shadow-glow: 0 0 32px rgba(99, 102, 241, .25);
    --brand-gradient-subtle: linear-gradient(135deg, #1a1735 0%, #2a1735 100%);
}

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-body);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--brand-primary-dark);
}

button {
    font-family: inherit;
    cursor: pointer;
}

table {
    border-collapse: collapse;
    width: 100%;
}

/* ── Utilities ── */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

.hidden {
    display: none !important;
}

.mt-24 {
    margin-top: 24px;
}

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(248, 249, 252, .85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

[data-theme="dark"] .site-header {
    background: rgba(12, 10, 29, .85);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

/* ── Logo (unique: £ glyph + gradient text) ── */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.logo-mark {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    font-family: var(--font-mono);
    box-shadow: 0 2px 8px rgba(99, 102, 241, .3);
    transition: transform var(--transition), box-shadow var(--transition);
}

.logo:hover .logo-mark {
    transform: scale(1.08);
    box-shadow: var(--shadow-glow);
}

.logo-text {
    letter-spacing: -.02em;
}

.logo-text span {
    color: var(--brand-primary);
}

/* ── Navigation ── */
.site-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-nav a,
.nav-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    font-size: .88rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    transition: all var(--transition);
}

.site-nav a:hover,
.nav-trigger:hover {
    color: var(--brand-primary);
    background: rgba(99, 102, 241, .08);
}

.chevron {
    font-size: .6em;
    transition: transform var(--transition);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px;
    padding-top: 16px;
    min-width: 260px;
    box-shadow: var(--shadow-lg);
    z-index: 200;
}

/* Invisible hover bridge between trigger and menu */
.nav-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 14px;
    display: none;
}

@media (hover: hover) {
    .nav-dropdown:hover::after {
        display: block;
    }

    .nav-dropdown:hover .dropdown-menu,
    .nav-dropdown:focus-within .dropdown-menu {
        display: block;
    }

    .nav-dropdown:hover .chevron {
        transform: rotate(180deg);
    }
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    color: var(--text-primary);
}

.dropdown-menu a:hover {
    background: rgba(99, 102, 241, .06);
    color: var(--brand-primary);
}

.dd-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 700;
    background: var(--brand-gradient-subtle);
    color: var(--brand-primary);
}

.dd-sep {
    height: 1px;
    background: var(--border);
    margin: 6px 14px;
}

/* ── Theme Toggle ── */
.btn-theme {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all var(--transition);
    color: var(--text-secondary);
}

.btn-theme:hover {
    background: rgba(99, 102, 241, .1);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

/* ── Mobile Nav Toggle ── */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 6px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition);
}

/* ── Hero ── */
.page-hero {
    padding: 48px 0 40px;
    background: var(--brand-gradient-subtle);
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, .08) 0%, transparent 70%);
    border-radius: 50%;
}

.page-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(244, 63, 94, .06) 0%, transparent 70%);
    border-radius: 50%;
}

.page-hero h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.03em;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.page-hero p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 620px;
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    position: relative;
    z-index: 1;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: .78rem;
    font-weight: 600;
    background: rgba(99, 102, 241, .08);
    color: var(--brand-primary);
    border: 1px solid rgba(99, 102, 241, .15);
}

/* ── Breadcrumbs ── */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    padding: 14px 0;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--brand-primary);
    font-weight: 500;
}

/* ── Page Body + Layout ── */
.page-body {
    padding: 32px 0 60px;
}

.layout--with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
}

.main-col {
    min-width: 0;
}

/* ── Card (calculator) ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand-gradient);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 0;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: .95rem;
    font-family: var(--font-mono);
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.card-body {
    padding: 20px 24px 24px;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    overflow: hidden;
}

.input-wrap:focus-within {
    border-color: var(--brand-primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.input-prefix {
    padding: 0 0 0 14px;
    font-weight: 700;
    color: var(--brand-primary);
    font-family: var(--font-mono);
    font-size: .95rem;
}

.input-wrap.no-prefix select {
    padding-left: 14px;
}

.input-wrap input,
.input-wrap select {
    width: 100%;
    padding: 12px 14px;
    border: none;
    background: transparent;
    font-size: .95rem;
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-sans);
}

.input-wrap select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236366f1' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.input-wrap select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px 12px;
}

[data-theme="dark"] .input-wrap select {
    background-color: var(--bg-input);
    color: var(--text-primary);
}

[data-theme="dark"] .input-wrap select option {
    background: #1a1735;
    color: #eef2ff;
}

/* Frequency Tabs */
.freq-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-pill);
}

.freq-tab {
    flex: 1;
    padding: 10px 6px;
    border: none;
    border-radius: var(--radius-pill);
    font-size: .8rem;
    font-weight: 600;
    background: transparent;
    color: var(--text-muted);
    transition: all var(--transition);
}

.freq-tab.active {
    background: var(--brand-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .3);
}

.freq-tab:not(.active):hover {
    color: var(--brand-primary);
    background: rgba(99, 102, 241, .08);
}

/* ── Results Panel ── */
.results-panel {
    margin-top: 24px;
    animation: slideUp .4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-headline {
    text-align: center;
    padding: 20px;
    background: var(--brand-gradient-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.result-headline .label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.result-headline .amount {
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-mono);
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -.02em;
}

.result-headline .period {
    font-size: .82rem;
    color: var(--text-muted);
}

/* Chart + Legend */
.chart-container {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.breakdown-legend {
    display: grid;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .85rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Breakdown Bar */
.breakdown-bar {
    display: flex;
    height: 10px;
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-bottom: 20px;
    background: var(--bg-input);
}

.seg {
    transition: width .6s ease;
}

.seg--net {
    background: var(--net-color);
}

.seg--tax {
    background: var(--tax-color);
}

.seg--ni {
    background: var(--ni-color);
}

.seg--student {
    background: var(--student-color);
}

/* Result Rows */
.result-rows {
    border-top: 1px solid var(--border);
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: .88rem;
}

.r-label {
    color: var(--text-secondary);
}

.r-value {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: .88rem;
}

.r-deduction .r-value {
    color: var(--brand-accent);
}

.r-total {
    border-bottom: none;
    padding-top: 14px;
}

.r-total .r-value {
    color: var(--brand-primary);
    font-size: 1.05rem;
    font-weight: 800;
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: center;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius-pill);
    font-size: .85rem;
    font-weight: 600;
    transition: all var(--transition);
    cursor: pointer;
}

.btn--primary {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 2px 10px rgba(99, 102, 241, .3);
}

.btn--primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn--secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn--secondary:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: rgba(99, 102, 241, .06);
}

/* ── Content Sections ── */
.content-section {
    margin-top: 36px;
}

.content-section h2 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.content-section h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 20px 0 10px;
}

.content-section p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.content-section ul {
    padding-left: 20px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.content-section li {
    margin-bottom: 8px;
}

.content-section li strong {
    color: var(--text-primary);
}

/* Info Box */
.info-box {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, .06);
    border-left: 4px solid var(--brand-primary);
    font-size: .88rem;
    color: var(--text-secondary);
    margin-top: 16px;
}

/* ── Stats Bar ── */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-item {
    text-align: center;
    padding: 20px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.stat-num {
    font-size: 1.4rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--brand-primary);
}

.stat-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 4px;
}

/* ── Data Table ── */
.data-table-wrap {
    overflow-x: auto;
    margin-top: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.data-table {
    min-width: 500px;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    background: var(--bg-input);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 10px 16px;
    font-size: .88rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table .highlight {
    font-weight: 700;
    color: var(--brand-primary);
    font-family: var(--font-mono);
}

/* ── Info Grid (monthly/weekly/daily/hourly) ── */
.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.info-card {
    text-align: center;
    padding: 18px 10px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.info-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.info-value {
    font-size: 1.15rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--brand-primary);
}

.info-label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 4px;
}

/* ── Salary Grid (internal linking) ── */
.salary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.salary-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: .88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    text-decoration: none;
}

.salary-card:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.amount-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: var(--brand-gradient);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* ── Feature Grid (niche calculators) ── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.feature-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
    text-decoration: none;
    color: var(--text-primary);
}

.feature-card:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.fc-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--brand-gradient-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.fc-title {
    font-weight: 700;
    font-size: .9rem;
}

.fc-desc {
    font-size: .78rem;
    color: var(--text-muted);
}

/* ── FAQ ── */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition);
}

.faq-item:hover {
    border-color: rgba(99, 102, 241, .3);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px 20px;
    text-align: left;
    font-size: .92rem;
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color var(--transition);
}

.faq-question:hover {
    color: var(--brand-primary);
}

.faq-icon {
    font-style: normal;
    font-weight: 300;
    font-size: 1.3rem;
    color: var(--brand-primary);
    transition: transform var(--transition);
    flex-shrink: 0;
    margin-left: 12px;
}

.faq-answer {
    display: none;
    padding: 0 20px 16px;
    font-size: .88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.faq-item.open .faq-answer {
    display: block;
    animation: fadeIn .2s ease;
}

.faq-item.open .faq-icon {
    transform: rotate(45deg);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ── Sidebar ── */
.sidebar {
    position: sticky;
    top: 80px;
}

.ad-slot {
    background: var(--bg-input);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    font-size: .78rem;
    color: var(--text-muted);
}

/* ── Footer ── */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 48px 0 24px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 32px;
}

.footer-brand p {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: 12px;
    line-height: 1.6;
}

.footer-col h4 {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 8px;
}

.footer-col a {
    font-size: .88rem;
    color: var(--text-secondary);
}

.footer-col a:hover {
    color: var(--brand-primary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    margin-top: 36px;
    padding-top: 20px;
    font-size: .78rem;
    color: var(--text-muted);
}

/* ── 404 ── */
.page-404 {
    text-align: center;
    padding: 60px 20px;
}

.page-404 .big-num {
    font-size: 6rem;
    font-weight: 900;
    font-family: var(--font-mono);
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.page-404 h1 {
    font-size: 1.5rem;
    margin: 12px 0;
}

.page-404 p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
    .layout--with-sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .site-header .container {
        height: 56px;
    }

    .nav-toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-body);
        z-index: 999;
        padding: 12px 20px 20px;
        overflow-y: auto;
        max-height: calc(100vh - 56px);
        border-top: 1px solid var(--border);
        box-shadow: 0 8px 32px rgba(0, 0, 0, .15);
        border-radius: 0 0 var(--radius) var(--radius);
    }

    .site-nav.open {
        display: block;
    }

    .site-nav ul {
        flex-direction: column;
        gap: 4px;
    }

    .site-nav a,
    .nav-trigger {
        padding: 14px 18px;
        border-radius: var(--radius-sm);
        width: 100%;
        justify-content: flex-start;
        font-size: 1rem;
        font-weight: 500;
    }

    .site-nav a:hover,
    .nav-trigger:hover {
        background: rgba(99, 102, 241, .08);
    }

    .nav-dropdown {
        position: static;
    }

    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        padding: 4px 0 4px 20px;
        min-width: unset;
        background: transparent;
    }

    .dropdown-menu a {
        padding: 12px 16px;
        font-size: .95rem;
    }

    .nav-dropdown.open .dropdown-menu {
        display: block;
    }

    .page-hero {
        padding: 32px 0 28px;
    }

    .page-hero h1 {
        font-size: 1.4rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .card-body {
        padding: 16px 18px 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .salary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stats-bar {
        grid-template-columns: 1fr;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}