/* ────────────────────────────────────────────────────────────────────────
   shared.css — common tokens, reset, and chrome shared by index.html and
   tutorial.html. admin.html intentionally does NOT import this: its token
   values (rgba borders, extra surface color, different radius) and layout
   diverge enough that sharing would mean overriding half of this anyway.

   Pages that import this can still redeclare/extend any of these rules in
   their own <style> block afterward (e.g. index.html adds --amber-dim,
   tutorial.html adds the badge color set).
   ──────────────────────────────────────────────────────────────────────── */

:root {
  --bg:        #F5F4F0;
  --surface:   #FFFFFF;
  --border:    #D0CEC8;
  --ink:       #1A1916;
  --ink-muted: #6B6860;
  --amber:     #C87D2F;
  --amber-bg:  #FDF3E3;
  --red:       #B84040;
  --red-bg:    #FDEAEA;
  --mono:      "JetBrains Mono", "Fira Mono", "Cascadia Code", ui-monospace, monospace;
  --sans:      "Inter", "Helvetica Neue", Arial, sans-serif;
  --radius:    3px;
}

/* ── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Body / page background ─────────────────────────────────────────── */
body {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);

  background-image:
    linear-gradient(to right,  rgba(0,0,0,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.045) 1px, transparent 1px);
  background-size: 24px 24px;

  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────────────────── */
header {
  position: relative;
  background: var(--ink);
  color: #F5F4F0;
  padding: 20px 32px 18px;
  border-bottom: 3px solid var(--amber);
}

header h1 {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
}

/* ── EN/NL toggle (top-right of header, both pages) ───────────────────── */
#lang-toggle-btn {
  position: absolute;
  top: 18px;
  right: 20px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: transparent;
  color: #B0AEA8;
  border: 1px solid #55534f;
  border-radius: var(--radius);
  padding: 3px 9px;
  cursor: pointer;
  transition: color 0.1s, border-color 0.1s;
}
#lang-toggle-btn:hover {
  color: var(--amber-dim, #E8C48A);
  border-color: var(--amber-dim, #E8C48A);
}

/* ── Header actions group (login widget + EN/NL toggle, both pages) ────
   A single wrapper so the two buttons move together — index.html's mobile
   collapse animation and tutorial.html's flex-wrap breadcrumb row each only
   have to reposition one element instead of keeping two in sync. Each page
   decides how the wrapper itself is positioned (absolute vs. flex item);
   #lang-toggle-btn's own positioning above is overridden back to static
   wherever it sits inside this wrapper. */
.header-actions-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-actions-top #lang-toggle-btn {
  position: static;
}

/* ── Account widget — discreet login affordance ─────────────────────── */
.account-widget { position: relative; }

.account-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: transparent;
  color: #B0AEA8;
  border: 1px solid #55534f;
  border-radius: var(--radius);
  padding: 3px 9px;
  cursor: pointer;
  transition: color 0.1s, border-color 0.1s;
}
.account-toggle-btn.logged-in {
  gap: 6px;
}
.account-toggle-btn:hover {
  color: var(--amber-dim, #E8C48A);
  border-color: var(--amber-dim, #E8C48A);
}
.account-icon-solid,
.account-icon-outline {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
/* Logged-out (default): solid icon only, no username.
   Logged-in (.logged-in): outline icon + username label. */
/* Logged-out (default): outline icon only, no username.
   Logged-in (.logged-in): solid icon + username label. */
.account-toggle-btn .account-icon-solid { display: none; }
.account-toggle-btn.logged-in .account-icon-outline { display: none; }
.account-toggle-btn.logged-in .account-icon-solid { display: block; }
.account-username { line-height: 1; }

.account-popover {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.account-popover.open { display: block; }
.account-popover label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 3px;
}
.account-popover input[type="text"],
.account-popover input[type="password"] {
  width: 100%;
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--bg);
  color: var(--ink);
}
.account-popover .remember-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 10px;
}
.account-popover .remember-row input { margin: 0; }
.account-popover button[type="submit"] {
  width: 100%;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 8px;
  border: 1px solid var(--amber-dim, #E8C48A);
  border-radius: var(--radius);
  background: var(--amber-bg);
  color: var(--amber);
  cursor: pointer;
}
.account-popover button[type="submit"]:hover { background: var(--amber); color: #fff; }
.account-popover .account-error {
  font-size: 10.5px;
  color: var(--red);
  margin-top: 6px;
  display: none;
}
.account-popover .account-error.show { display: block; }
.account-popover .account-status {
  font-size: 11.5px;
  color: var(--ink);
  margin-bottom: 10px;
}
.account-popover .account-logout-btn {
  width: 100%;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}
.account-popover .account-logout-btn:hover { color: var(--red); border-color: var(--red-bg); background: var(--red-bg); }

/* ── Footer ──────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 12px 32px;
  background: var(--surface);
}

footer p {
  font-size: 11px;
  color: #A0A098;
}
