@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700;800&display=swap');

:root {
    --bg: #0a0c14;
    --bg-soft: #0d0f1c;
    --card: rgba(255,255,255,0.04);
    --border: rgba(255,255,255,0.08);
    --text: #ffffff;
    --muted: rgba(255,255,255,0.55);
    --accent: #4f6ef7;
    --accent-hover: #6b84ff;
    --accent-dim: #3a56e8;
    --pass: #2fbf71;
    --warn: #e6a23c;
    --fail: #ef5350;
    --radius: 14px;
    --maxw: 1080px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
}

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

h1, h2, h3 {
    font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    line-height: 1.2;
    margin: 0 0 .4em;
}
h1:focus { outline: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ── Topbar ── */
.topbar {
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(10,12,20,0.80);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 10;
}
.topbar .container {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.brand-wrap {
    display: flex; align-items: center; gap: 12px; text-decoration: none;
}
.brand-wrap:hover { text-decoration: none; }
.xipe-logo {
    height: 32px; width: auto; display: block;
}
.brand-divider {
    width: 1px; height: 22px;
    background: rgba(255,255,255,0.18);
}
.brand-product {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -.02em;
    color: #fff;
}
.brand-product span { color: var(--accent-hover); }

.nav-links a {
    color: rgba(255,255,255,0.75);
    margin-left: 28px;
    font-size: .92rem;
    transition: color .15s;
}
.nav-links a:hover { color: #fff; text-decoration: none; }

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 90px 0 56px;
    background:
        radial-gradient(ellipse 80% 40% at 50% -5%, rgba(79,110,247,.22), transparent 65%),
        radial-gradient(ellipse 60% 30% at 80% 10%, rgba(107,132,255,.10), transparent 60%);
}
.hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.1rem, 4.5vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -.03em;
    background: linear-gradient(160deg, #fff 40%, rgba(255,255,255,.6));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); font-size: 1.12rem; max-width: 620px; margin: 0 auto 34px; }

/* ── Audit form ── */
.audit-form {
    display: flex; gap: 10px; max-width: 620px; margin: 0 auto;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    padding: 8px; border-radius: var(--radius);
}
.audit-form input {
    flex: 1; background: transparent; border: 0; color: var(--text);
    font-size: 1rem; padding: 12px 14px; outline: none;
}
.audit-form input::placeholder { color: rgba(255,255,255,0.3); }

/* ── Buttons ── */
.btn {
    background: var(--accent);
    color: #fff;
    border: 0; border-radius: 10px; padding: 12px 24px;
    font-family: 'Inter', sans-serif;
    font-weight: 600; font-size: .98rem; cursor: pointer; white-space: nowrap;
    transition: background .15s, transform .15s, box-shadow .15s;
}
.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(79,110,247,.35);
}
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85);
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.3);
    box-shadow: none;
    transform: none;
}

/* ── Cards ── */
.card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius); padding: 24px;
}
.section { padding: 40px 0; }

/* ── Score ring ── */
.score-wrap { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.ring {
    --p: 0; width: 140px; height: 140px; border-radius: 50%;
    display: grid; place-items: center; flex: none;
    background: conic-gradient(var(--ring-color) calc(var(--p) * 1%), rgba(255,255,255,.06) 0);
}
.ring > div {
    width: 110px; height: 110px; border-radius: 50%;
    background: #0d0f1c;
    display: grid; place-items: center; text-align: center;
}
.ring b { font-size: 2.1rem; }
.ring small { color: var(--muted); display: block; font-size: .72rem; }
.grade-pill {
    font-size: 2.4rem; font-weight: 800; padding: 4px 18px; border-radius: 12px;
    background: rgba(255,255,255,0.06);
}

/* ── Check cards ── */
.check {
    border: 1px solid rgba(255,255,255,0.07); border-radius: 12px;
    padding: 16px 18px; margin-bottom: 12px;
    background: rgba(255,255,255,0.03);
}
.check-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.check-title { font-weight: 600; }
.badge {
    font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
    text-transform: uppercase; letter-spacing: .04em;
}
.b-pass { background: rgba(47,191,113,.16); color: var(--pass); }
.b-warn { background: rgba(230,162,60,.16); color: var(--warn); }
.b-fail { background: rgba(239,83,80,.16); color: var(--fail); }
.b-info { background: rgba(255,255,255,.08); color: var(--muted); }
.check-summary { color: var(--muted); margin: 8px 0 0; font-size: .94rem; }
.recs { margin: 10px 0 0; padding-left: 18px; color: rgba(255,255,255,.75); font-size: .9rem; }
.recs li { margin: 4px 0; }
.cat-label {
    text-transform: uppercase; letter-spacing: .1em; font-size: .74rem;
    color: var(--muted); margin: 28px 0 10px; font-weight: 700;
}

/* ── Gate ── */
.gate { max-width: 460px; margin: 30px auto; text-align: center; }
.gate input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text); padding: 13px 14px; border-radius: 10px; margin: 14px 0;
    font-size: 1rem; outline: none;
    transition: border-color .15s, background .15s;
}
.gate input:focus {
    border-color: rgba(107,132,255,0.55);
    background: rgba(255,255,255,0.09);
}

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,0.06); }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: rgba(255,255,255,0.03); }

/* ── Tabs ── */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--muted);
    padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: .9rem;
    transition: all .15s;
}
.tabs button.active { background: var(--accent); color: #fff; border-color: transparent; }
.tabs button:hover:not(.active) { border-color: rgba(255,255,255,0.25); color: #fff; }

/* ── Chips ── */
.chip {
    display: inline-block;
    background: rgba(79,110,247,0.12);
    color: var(--accent-hover);
    padding: 4px 10px; border-radius: 8px; font-size: .82rem; margin: 4px 6px 0 0;
    border: 1px solid rgba(79,110,247,0.2);
}

/* ── Misc ── */
.muted { color: var(--muted); }
.error-box {
    background: rgba(239,83,80,.10);
    border: 1px solid rgba(239,83,80,.35);
    color: #ffb4b2; padding: 14px 16px; border-radius: 10px;
}
.spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.2);
    border-top-color: var(--accent-hover);
    border-radius: 50%; display: inline-block;
    animation: spin .7s linear infinite; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ── */
footer {
    color: var(--muted); font-size: .85rem; padding: 40px 0; text-align: center;
    border-top: 1px solid rgba(255,255,255,0.06);
}
footer a { color: rgba(255,255,255,0.5); }
footer a:hover { color: #fff; text-decoration: none; }

/* ── Legal ── */
.legal { line-height: 1.7; }
.legal h2 { margin-top: 1.6em; }
.legal h3 { margin-top: 1.3em; color: rgba(255,255,255,.8); }
.legal ul { padding-left: 20px; }
.legal a { color: var(--accent-hover); }

/* ── Cookie banner ── */
.cookie-banner {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 900;
    max-width: 920px; margin: 0 auto;
    background: #0d0f1c;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius); padding: 16px 20px;
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    box-shadow: 0 16px 48px rgba(0,0,0,.6);
}
.cookie-text { flex: 1; min-width: 260px; font-size: .9rem; color: var(--muted); }
.cookie-text p { margin: 0; }
.cookie-text a { color: var(--accent-hover); }
.cookie-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cookie-prefs { display: flex; gap: 20px; flex-wrap: wrap; font-size: .88rem; }
.cookie-prefs label { display: flex; gap: 8px; align-items: center; }

/* ── Blazor error UI ── */
#blazor-error-ui {
    background: #1a0c10; color: #ffb4b2; bottom: 0; display: none;
    left: 0; padding: 12px 20px; position: fixed; width: 100%; z-index: 1000;
    border-top: 1px solid rgba(239,83,80,.3);
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; }
