/* Aarocademy website styles. No inline styles in the pages (strict CSP), everything lives here.
   Palette and font from the device (simulator/ui/theme.js). der = blue, die = red, das = green. */
@font-face {
  font-family: 'Baloo 2';
  src: url('/fonts/baloo2-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Baloo 2';
  src: url('/fonts/baloo2-latin-ext.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #26243a;
  --bg: #fbf7f0;
  --white: #ffffff;
  --muted: #5f5b72;
  --line: #e4ddd1;
  --panel: #f1ece3;
  --sun: #ffedc1;
  --accent: #00737d;
  --accent-dark: #005a62;
  --accent-soft: #e3f6f7;
  --der: #337bd0;
  --die: #cb4644;
  --das: #2a904b;
  --cloud: #2f6fbf;
  --cloud-soft: #eaf2fd;
  --radius: 16px;
  --head: 'Baloo 2', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--body); }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800; }
h2 { font-size: 1.6rem; font-weight: 700; margin-top: 1.6em; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }
pre { background: var(--ink); color: #f5f3ff; padding: 16px 18px; border-radius: 12px; overflow-x: auto; font-size: 0.9rem; line-height: 1.5; }
code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--white); padding: 8px 12px; z-index: 10; }

.page { min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.main { flex: 1; padding-top: 40px; padding-bottom: 64px; }

/* ---- header / footer */
.header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font: 800 1.4rem var(--head); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.langs { margin-left: auto; }
.main > section, .main > .two-col { margin-top: 48px; }
.main > section:first-child, .main > .hero { margin-top: 0; }
.nav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; }
.nav a:hover { background: var(--panel); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent-dark); }
.langs { display: flex; gap: 2px; }
.langs a { min-width: 44px; min-height: 44px; display: grid; place-items: center; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.langs a:hover { background: var(--panel); color: var(--ink); }
.langs a[aria-current='true'] { background: var(--ink); color: var(--white); }

.footer { background: var(--panel); border-top: 1px solid var(--line); font-size: 0.95rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 24px; padding-bottom: 24px; }
.footer-row p { margin: 0; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ---- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 999px;
  border: 2px solid var(--accent); background: var(--accent); color: var(--white); font: 700 1rem var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--white); }
.btn.secondary { background: var(--white); color: var(--accent-dark); }
.btn.secondary:hover { background: var(--accent-soft); color: var(--accent-dark); }
.btn.danger { background: var(--white); border-color: var(--die); color: #a3302e; }
.btn.danger:hover { background: #fdecec; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 0.9rem; }
.btn:disabled { opacity: 0.6; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---- home */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 32px; }
.hero-text { flex: 999 1 420px; }
.hero-egg { flex: 1 1 220px; max-width: 300px; margin: 0 auto; }
.tagline { font: 700 1.5rem/1.3 var(--head); color: var(--accent-dark); }
.lead { font-size: 1.12rem; max-width: 62ch; }
.chips { display: flex; gap: 8px; margin: 4px 0 24px; }
.chip { font: 700 1.05rem var(--head); color: var(--white); padding: 2px 14px; border-radius: 999px; }
.chip.der { background: var(--der); }
.chip.die { background: var(--die); }
.chip.das { background: var(--das); }

.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.card p { margin: 0; color: var(--muted); }
.two-col { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.two-col > * { flex: 1 1 360px; min-width: 0; }
.panel { background: var(--panel); border-radius: var(--radius); padding: 20px 24px; }
.panel h2, .two-col > div > h2:first-child { margin-top: 0; }

/* ---- how it works */
.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.step { display: flex; gap: 16px; align-items: flex-start; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.step h3 { margin-bottom: 4px; }
.step p { margin: 0; color: var(--muted); }
.step-num { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--sun); font: 800 1.2rem var(--head); }
.list { padding-left: 1.2em; }
.list li { margin-bottom: 6px; }

/* ---- data flow */
.flow { margin: 24px 0 0; display: grid; gap: 20px; }
.flow-lane { background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 20px 24px 24px; }
.flow-lane-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-bottom: 16px; }
.flow-lane-head h3 { font: 700 0.85rem var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.flow-legend { font-size: 0.85rem; color: var(--muted); }
.flow-row { display: flex; align-items: flex-start; gap: 8px; }
.flow-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.flow-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; border: 2px solid #cbd5e1; background: var(--white); font-size: 0.95rem; line-height: 1.45; min-height: 112px; }
.flow-card b { display: block; margin-bottom: 2px; }
.flow-card.server { border-color: var(--accent); background: var(--accent-soft); }
.flow-card.cloud { border-color: var(--cloud); background: var(--cloud-soft); }
.flow-card.end { border-style: dashed; border-color: #8f97a6; background: #f4f5f7; min-height: 96px; }
.flow-icon { flex: none; width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.flow-card.server .flow-icon { color: var(--accent); }
.flow-card.cloud .flow-icon { color: var(--cloud); }
.flow-drop { align-self: center; width: 0; height: 32px; border-left: 2px dashed #8f97a6; }
.arrows { flex: 0 0 104px; display: flex; flex-direction: column; gap: 14px; padding-top: 22px; }
.arrows.single { padding-top: 42px; }
.arrow { display: flex; flex-direction: column; align-items: center; font-size: 0.8rem; color: var(--muted); }
.arrow-label { min-height: 1.2em; }
.arrow svg { width: 100%; height: 12px; stroke: #5b6474; stroke-width: 2; fill: #5b6474; }
.arrow.muted svg { stroke: #8f97a6; fill: #8f97a6; stroke-dasharray: 5 5; }
.flow-note { font-size: 0.9rem; color: var(--muted); }

@media (max-width: 760px) {
  .header-row { padding-top: 10px; padding-bottom: 6px; }
  .nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -8px; scrollbar-width: none; }
  .nav a { white-space: nowrap; }
  .flow-row { flex-direction: column; align-items: stretch; }
  .arrows, .arrows.single { flex: none; flex-direction: row; justify-content: center; gap: 24px; padding: 4px 0; }
  .arrow { flex-direction: row; gap: 6px; }
  .arrow svg { width: 40px; transform: rotate(90deg); }
  .flow-card, .flow-card.end { min-height: 0; }
}

/* ---- forms */
.form { display: grid; gap: 16px; max-width: 560px; }
.form.narrow { max-width: 360px; }
.form label { display: grid; gap: 6px; }
.form label > span { font-weight: 600; }
.form input, .form textarea { font: inherit; padding: 12px 14px; border-radius: 12px; border: 1.5px solid #c9c2b5; background: var(--white); color: var(--ink); min-height: 48px; }
.form input[aria-invalid='true'], .form textarea[aria-invalid='true'] { border-color: var(--die); }
.form .btn { justify-self: start; }
.hint { color: var(--muted); font-size: 0.92rem; }
.error { color: #a3302e; font-weight: 600; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.success { background: var(--accent-soft); border-radius: var(--radius); padding: 20px 24px; }
.success h2 { margin-top: 0; }

/* ---- legal */
.legal { max-width: 760px; }
.legal address { font-style: normal; margin-bottom: 1em; }
.note { background: var(--sun); border-radius: 10px; padding: 10px 14px; }
.pre { white-space: pre-line; }

/* ---- admin */
.admin-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.table-box { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: var(--panel); white-space: nowrap; }
.table .msg { max-width: 280px; white-space: pre-wrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: 0.8rem; }
.status.pending { background: var(--sun); }
.status.approved { background: #dff3e6; color: #1d6b37; }
.status.rejected { background: #fdecec; color: #a3302e; }
.status.expired { background: var(--panel); color: var(--muted); }

.row-actions form { margin: 0; }
.actions form { margin: 0; }
.login-hint { margin: 0 0 24px; }
.cost-note { margin: 0 0 16px; max-width: 72ch; }
.cost-note p:last-child { margin-bottom: 0; }
.cost-note h2 { margin-top: 0; }

/* Homepage video */
.video video { display: block; width: 100%; max-width: 960px; height: auto; border-radius: var(--radius); background: #26243A; }
