:root {
    --bg: #c8dedd;
    --text: #1f222b;
    --muted: #5f6b76;
    --accent: #ff715e;
    --accent-strong: #ff5e49;
    --chip-bg: #ffffff;
    --chip-border: rgba(24, 24, 38, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; min-height: 100%; }

body {
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.30), transparent 38%),
        var(--bg);
    color: var(--text);
}

.page-interests {
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* ── Screen shell ── */
.interests-screen {
    width: 100%;
    max-width: 480px;
    min-height: 100dvh;
    margin: 0 auto;
    padding: 0.85rem 0.9rem 0;
    display: grid;
    grid-template-rows: auto auto 1fr auto auto;
    gap: 0.7rem;
    position: relative;
    isolation: isolate;
}

/* ── Glows (soft, like the auth screens) ── */
.interests-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(28px);
    pointer-events: none;
    z-index: 0;
}

.interests-glow-a {
    width: min(44vw, 240px);
    height: min(44vw, 240px);
    top: 4%; left: -8%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.32), transparent 72%);
}

.interests-glow-b {
    width: min(44vw, 280px);
    height: min(44vw, 280px);
    right: -10%; bottom: 12%;
    background: radial-gradient(circle, rgba(255, 113, 94, 0.12), transparent 72%);
}

/* ── Logo ── */
.interests-logo {
    width: 56px;
    height: auto;
    margin: 0.2rem auto 0;
    position: relative;
    z-index: 1;
}

/* ── Header ── */
.interests-header {
    text-align: center;
    display: grid;
    gap: 0.25rem;
    position: relative;
    z-index: 1;
}

.interests-kicker {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(31, 34, 43, 0.5);
}

.interests-title {
    font-size: clamp(1.5rem, 6vw, 1.95rem);
    font-weight: 800;
    line-height: 1.1;
}

.interests-subtitle {
    font-size: 0.86rem;
    color: var(--muted);
    line-height: 1.4;
    max-width: 34ch;
    margin: 0.05rem auto 0;
}

.interests-meta {
    margin-top: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.interests-limit {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
}

.interests-clear,
.interests-skip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.2rem 0.4rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    border-radius: 8px;
}

.interests-clear:focus-visible,
.interests-skip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ── One clean card (matches the auth screens) ── */
.interests-panel {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    padding: 1rem 0.9rem 1.1rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 18px 36px rgba(24, 39, 48, 0.08);
    contain: layout paint;
}

/* ── Category sections — just a title + chips, no nested card ── */
.interest-section {
    display: grid;
    gap: 0.55rem;
    margin-top: 1.1rem;
    content-visibility: auto;
    contain-intrinsic-size: 0 180px;
}

.interest-section:first-of-type { margin-top: 0; }

.interest-section-title {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(31, 34, 43, 0.5);
    padding-left: 0.1rem;
}

/* ── Chip grid ── */
.interests-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

/* ── Chips — modern, lightly rounded, simple ── */
.interest-chip {
    border: 1.5px solid var(--chip-border);
    background: var(--chip-bg);
    color: var(--text);
    border-radius: 11px;
    padding: 0.5rem 0.85rem;
    min-height: 40px;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* "Recommended" chips get a faint accent so they stand out, subtly */
.interest-chip-core {
    border-color: rgba(255, 113, 94, 0.35);
}

.interest-chip.is-selected {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 700;
}

.interest-chip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .interest-chip:not(.is-selected):hover {
        border-color: rgba(255, 113, 94, 0.55);
    }
}

/* ── Sticky action bar ── */
.interests-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    display: flex;
    justify-content: center;
    padding: 0.55rem 0 calc(var(--app-safe-bottom, 0px) + 0.7rem);
    background: linear-gradient(to top, var(--bg) 62%, transparent);
}

/* ── Continue button (matches the auth primary button) ── */
.interests-continue {
    width: 100%;
    max-width: 360px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    padding: 0.9rem 1.2rem;
    min-height: 52px;
    cursor: pointer;
    box-shadow: 0 14px 22px rgba(255, 113, 94, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.46rem;
    transition: opacity 0.16s ease, transform 0.12s ease;
}

.interests-continue:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.interests-continue:not(:disabled):active { transform: scale(0.99); }

.interests-continue:focus-visible {
    outline: 2.5px solid var(--accent);
    outline-offset: 3px;
}

.interests-continue-spinner {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    display: none;
    flex: 0 0 auto;
}

.interests-continue.is-submitting { opacity: 0.85; }

.interests-continue.is-submitting .interests-continue-spinner {
    display: inline-block;
    animation: chipButtonSpin 0.9s linear infinite;
}

@keyframes chipButtonSpin {
    to { transform: rotate(360deg); }
}

/* ── Credit ── */
.interests-credit {
    text-align: center;
    color: rgba(31, 34, 43, 0.4);
    font-size: 0.72rem;
    padding: 0.2rem 0 0.5rem;
    position: relative;
    z-index: 1;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .interest-chip,
    .interests-continue {
        transition: none;
    }
    .interests-continue.is-submitting .interests-continue-spinner {
        animation: none;
    }
}

/* ── Narrow screens ── */
@media (max-width: 380px) {
    .interests-screen { padding: 0.7rem 0.75rem 0; }
    .interests-panel  { padding: 0.85rem 0.75rem 1rem; border-radius: 18px; }
    .interest-chip    { padding: 0.45rem 0.72rem; font-size: 0.8rem; min-height: 38px; }
}

/* ── Super-admin dark theme ── */
body.theme-super-admin.page-interests {
    --bg: #0f161d;
    --text: #eef6f1;
    --muted: #a4b3bb;
    --accent: #ff7a60;
    --accent-strong: #f05f47;
    --chip-bg: rgba(20, 30, 38, 0.92);
    --chip-border: rgba(160, 200, 190, 0.18);
    background:
        radial-gradient(circle at top, rgba(255, 122, 96, 0.09), transparent 30%),
        linear-gradient(180deg, #121923 0%, #0d141b 100%);
}

body.theme-super-admin.page-interests .interests-kicker,
body.theme-super-admin.page-interests .interest-section-title {
    color: rgba(238, 246, 241, 0.55);
}

body.theme-super-admin.page-interests .interests-subtitle,
body.theme-super-admin.page-interests .interests-credit {
    color: rgba(238, 246, 241, 0.7);
}

body.theme-super-admin.page-interests .interests-panel {
    background: rgba(17, 26, 33, 0.88);
    border-color: rgba(160, 200, 190, 0.14);
    box-shadow: 0 20px 40px rgba(2, 8, 12, 0.24);
}

body.theme-super-admin.page-interests .interest-chip {
    background: rgba(14, 22, 30, 0.92);
    border-color: rgba(160, 200, 190, 0.18);
    color: var(--text);
}

body.theme-super-admin.page-interests .interest-chip-core {
    border-color: rgba(255, 122, 96, 0.3);
}

body.theme-super-admin.page-interests .interest-chip.is-selected {
    background: linear-gradient(135deg, #ff7a60, #ef624a);
    color: #fff8f4;
    border-color: transparent;
}

body.theme-super-admin.page-interests .interest-chip:focus-visible {
    outline-color: #ff7a60;
}

body.theme-super-admin.page-interests .interests-clear,
body.theme-super-admin.page-interests .interests-skip {
    color: #ff9a80;
}

body.theme-super-admin.page-interests .interests-continue {
    color: #fff8f4;
    box-shadow: 0 14px 26px rgba(255, 122, 96, 0.22);
}

/* ── Touch optimizations ── */
.interest-chip,
.interests-continue,
.interests-clear,
.interests-skip { touch-action: manipulation; }
