/* ==========================================================================
   ESNL - gedeelde huisstijl (website + Control Panel)
   Gebaseerd op de in-game UI (esnl_core / esnl_hud / esnl_loadingscreen):
   Inter, oranje #ff6600 als enige accent, donkere panelen, compacte radius.
   ========================================================================== */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('../fonts/Inter-400.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('../fonts/Inter-500.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('../fonts/Inter-600.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('../fonts/Inter-700.woff') format('woff'); }

:root {
    --accent: #ff6600;
    --accent-hover: #ff7a1f;
    --ink: #07090c;
    --ink-2: #0d1015;
    --ok: #3ecf8e;
    --warn: #f2c230;
    --bad: #e63c3c;
    --info: #3d7bff;
    --r-sm: 6px;
    --r: 10px;
    --r-lg: 14px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --wrap: 1200px;
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --mono: ui-monospace, 'Cascadia Mono', 'Consolas', 'SFMono-Regular', monospace;
}

:root, :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b0e12;
    --bg-2: #0f1318;
    --surface: #141920;
    --surface-2: #1a2029;
    --surface-3: #212833;
    --line: rgba(255, 255, 255, .08);
    --line-2: rgba(255, 255, 255, .15);
    --text: #e9ecf0;
    --text-2: #b6bec8;
    --muted: #8e97a2;
    --accent-ink: #ff8a3d;
    --accent-soft: rgba(255, 102, 0, .13);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px rgba(0, 0, 0, .28);
    --focus: 0 0 0 3px rgba(255, 102, 0, .45);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #ffffff;
    --bg-2: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f3f5f8;
    --surface-3: #e9edf2;
    --line: #e3e7ec;
    --line-2: #cfd5dd;
    --text: #14171c;
    --text-2: #3b4450;
    --muted: #5f6a77;
    --accent-ink: #c24e00;
    --accent-soft: #fff1e7;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 30px rgba(16, 24, 40, .08);
    --focus: 0 0 0 3px rgba(255, 102, 0, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font-family: var(--font); font-size: 16px; line-height: 1.6;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background-color .25s ease, color .25s ease;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.015em; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
::selection { background: rgba(255, 102, 0, .3); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow {
    display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .14em;
    text-transform: uppercase; color: var(--accent-ink); margin-bottom: .75rem;
}

/* ---------- Knoppen (zelfde vorm als in-game .btn / .btn-primary) ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    height: 42px; padding: 0 1.1rem; border-radius: var(--r-sm); border: 1px solid transparent;
    font-size: .92rem; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none !important;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s var(--ease), box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn .ic { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px rgba(255, 102, 0, .22); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-2); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #f04f4f; }
.btn-discord { background: #5865f2; color: #fff; }
.btn-discord:hover { background: #4752e0; color: #fff; }
.btn-on-dark { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); color: #e9ecf0; }
.btn-on-dark:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-sm { height: 34px; padding: 0 .8rem; font-size: .84rem; }
.btn-xs { height: 28px; padding: 0 .6rem; font-size: .78rem; gap: .35rem; }
.btn-xs .ic { width: 14px; height: 14px; }
.btn-lg { height: 50px; padding: 0 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }

.icon-btn {
    display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm);
    border: 1px solid var(--line); background: transparent; color: var(--text-2);
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.linklike { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; }
.linklike:hover { color: var(--accent-ink); }

.link-arrow { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.link-arrow .ic { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.link-arrow:hover { text-decoration: none; }
.link-arrow:hover .ic { transform: translateX(3px); }

/* ---------- Kaarten ---------- */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 1.4rem; box-shadow: var(--shadow-sm);
}

/* ---------- Statusbolletje ---------- */
.pulse { position: relative; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.pulse-online { background: var(--ok); }
.pulse-maintenance { background: var(--warn); }
.pulse-offline { background: var(--bad); }
.pulse-online::after {
    content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok);
    opacity: 0; animation: ping 2.4s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.6); opacity: .7; } 80%, 100% { transform: scale(1.6); opacity: 0; } }

.badge {
    display: inline-flex; align-items: center; gap: .35rem; height: 22px; padding: 0 .55rem;
    border-radius: 999px; font-size: .72rem; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
    background: var(--surface-3); color: var(--text-2);
}
.badge-ok { background: rgba(62, 207, 142, .14); color: #1f9d68; }
.badge-warn { background: rgba(242, 194, 48, .16); color: #a07a00; }
.badge-bad { background: rgba(230, 60, 60, .14); color: #c62f2f; }
.badge-info { background: rgba(61, 123, 255, .14); color: #2f63d6; }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
:root[data-theme="dark"] .badge-ok { color: #5fe0a6; }
:root[data-theme="dark"] .badge-warn { color: #f6d266; }
:root[data-theme="dark"] .badge-bad { color: #ff7b7b; }
:root[data-theme="dark"] .badge-info { color: #7ea6ff; }

/* ---------- Formulieren ---------- */
.field { display: grid; gap: .4rem; }
.field > span, .label { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.input, .select, .textarea {
    width: 100%; height: 40px; padding: 0 .8rem; border-radius: var(--r-sm);
    border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { height: auto; padding: .7rem .8rem; line-height: 1.55; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.hint { font-size: .8rem; color: var(--muted); }

.switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: background-color .2s ease; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:disabled + span { opacity: .55; }
.switch input:focus-visible + span { box-shadow: var(--focus); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5, 7, 10, .62); backdrop-filter: blur(4px); animation: fadeIn .2s ease; }
.modal-card {
    position: relative; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 2rem 1.8rem 1.6rem; box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
    animation: modalIn .28s var(--ease);
}
.modal-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.modal-card h2 { font-size: 1.35rem; margin-bottom: .5rem; }
.modal-close { position: absolute; top: 12px; right: 12px; border: 0; }
.modal-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.lead-sm { color: var(--text-2); font-size: .95rem; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
body.modal-open { overflow: hidden; }

/* ---------- Callouts ---------- */
.callout {
    position: relative; padding: .9rem 1rem .9rem 1.1rem; margin: 1.2rem 0; border-radius: var(--r);
    background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: .95rem;
}
.callout::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--info); }
.callout-tip::before { background: var(--ok); }
.callout-warn::before { background: var(--accent); }
.callout strong { color: var(--text); }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); margin: 1.2rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .65rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .76rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }

/* placeholder in juridische teksten */
.ph { display: inline-block; padding: 0 .4rem; border-radius: 4px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: .92em; border: 1px dashed currentColor; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: grid; gap: .5rem; width: min(380px, calc(100vw - 32px)); }
.toast {
    position: relative; padding: .8rem 1rem .8rem 1.1rem; border-radius: var(--r); background: var(--surface);
    border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .9rem; animation: modalIn .25s var(--ease);
}
.toast::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.toast.ok::before { background: var(--ok); }
.toast.bad::before { background: var(--bad); }

.empty { display: grid; place-items: center; gap: .6rem; padding: 3rem 1rem; color: var(--muted); text-align: center; }
.empty .ic { width: 28px; height: 28px; }

/* Logo licht/donker */
.logo-on-light { display: none; }
:root[data-theme="light"] .logo-on-light { display: block; }
:root[data-theme="light"] .logo-on-dark { display: none; }

/* 'Minder beweging' (staat op Windows Server standaard aan): de binnenkomst-animaties\n   blijven (eenmalig, kort), alleen herhalende effecten gaan uit. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    *, *::before, *::after { animation-iteration-count: 1 !important; }
    .pulse-online::after, .stripes i::after { animation: none !important; display: none; }
}
