:root {
    --bg: #0b0d10;
    --card: #131720;
    --text: #e7eaf0;
    --muted: #a9b1c3;
    --border: rgba(255, 255, 255, 0.08);
    --error: #ffb4b4;
    --link: #9cc9ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        Arial,
        sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--link);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 20px;
}

/* ---------------- NAV ---------------- */

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    position: relative;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
}

.logo {
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 10px;
}

/* Desktop menu */
.nav-menu {
    margin-left: auto;
    display: inline-flex;
    gap: 10px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

/* Consistent pill size */
.nav-btn,
.lang-select {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    outline: none;
    appearance: none;
    white-space: nowrap;
    line-height: 1;
}

.nav-btn {
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-weight: 600;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.lang-select {
    width: 52px;
    padding: 0 10px;
    font-size: 18px;
    background: transparent;
    border: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
}

.lang-select::-ms-expand {
    display: none;
}

/* Hamburger */
.nav-toggle {
    display: none;
    width: 44px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    flex-direction: column; /* stack bars vertically */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
    flex: 0 0 auto;
    margin-left: auto; /* push to far right of nav */
}

.nav-toggle .bar {
    display: block;
    width: 20px;
    height: 2px;
    margin: 3px 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
}

/* nav logout button */
.nav-logout {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
}
.nav-logout:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* ---------------- MOBILE NAV ---------------- */

@media (max-width: 760px) {
    .nav-menu {
        position: absolute;
        right: 0;
        top: 56px;
        display: none;
        flex-direction: column;
        width: auto; /* shrink to fit widest item */
        min-width: fit-content;
        padding: 8px;
        border-radius: 16px;
        border: 1px solid var(--border);
        background: rgba(10, 12, 18, 0.98);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    }

    .nav-menu[data-open="true"] {
        display: flex;
    }

    .nav-toggle {
        display: inline-flex;
    }

    /* Stack items vertically, right-aligned */
    .nav-right {
        flex-direction: column;
        align-items: stretch; /* all items same width */
        gap: 4px;
    }

    /* All items fill container width — right-justified text, equal padding */
    .nav-btn,
    .lang-select {
        width: 100%;
        height: auto;
        justify-content: flex-end;
        text-align: right;
        padding: 10px 16px;
        border-radius: 10px;
    }

    /* Flag gets the same pill border as the nav buttons */
    .lang-select {
        font-size: 16px;
        padding: 10px 16px;
        border: 1px solid var(--border);
        background: rgba(255, 255, 255, 0.03);
    }

    /* Logout form matches */
    .nav-inline {
        width: 100%;
    }
    .nav-inline .nav-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ---------------- HEADER ---------------- */

.header h1 {
    margin: 0 0 6px;
    font-size: 28px;
}

.header p {
    margin: 0 0 18px;
    color: var(--muted);
}

/* ---------------- CARDS ---------------- */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    margin: 12px 0;
}

.cardInner {
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

/* ---------------- GRID ---------------- */

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 760px) {
    .grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---------------- FORM ---------------- */

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
}

input,
select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    outline: none;
}

button {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
}

/* ---------------- SPINNER / HTMX INDICATOR ---------------- */
.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    opacity: 0;
    transition: opacity 200ms ease-in;
    pointer-events: none;
}
.htmx-request .status,
.htmx-request.status {
    opacity: 1;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: #4285f4;
    border-right-color: #fbbc05;
    border-bottom-color: #ea4335;
    border-left-color: #34a853;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* ---------------- UTIL ---------------- */

.muted {
    color: var(--muted);
}
.error {
    color: var(--error);
}

.dl-cell {
    white-space: nowrap;
}
.dl-btn {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    margin-right: 4px;
}
.dl-btn:hover {
    color: var(--fg);
    border-color: var(--fg);
}

.footer {
    margin-top: 18px;
    color: var(--muted);
    text-align: center;
}
.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-bottom: 0.6rem;
}
.footer-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
}
.footer-nav a:hover {
    color: var(--fg);
}

.del-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition:
        background 0.15s,
        color 0.15s,
        border-color 0.15s;
}
.del-btn:hover {
    background: rgba(220, 50, 50, 0.12);
    border-color: rgba(220, 50, 50, 0.5);
    color: #f87171;
}
/* ── COOKIE BANNER — append to styles.css ──────────────────────────────────── */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(10, 12, 18, 0.97);
    border-top: 1px solid var(--border);
    padding: 14px 20px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
}

.cookie-inner {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1 1 300px;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: baseline;
}

.cookie-text strong {
    color: var(--text);
    margin-right: 4px;
}

.cookie-learn {
    color: var(--link);
    font-size: 13px;
    white-space: nowrap;
}

.cookie-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.cookie-btn {
    height: 36px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition:
        background 0.15s,
        border-color 0.15s;
}

.cookie-btn--decline {
    background: transparent;
    color: var(--muted);
}

.cookie-btn--decline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.cookie-btn--accept {
    background: rgba(124, 106, 247, 0.15);
    border-color: rgba(124, 106, 247, 0.5);
    color: #c4b8ff;
}

.cookie-btn--accept:hover {
    background: rgba(124, 106, 247, 0.28);
    border-color: rgba(124, 106, 247, 0.8);
}

@media (max-width: 600px) {
    .cookie-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .cookie-actions {
        justify-content: flex-end;
    }
}
