:root {
  --brand: #2447e0;
  --brand-ink: #ffffff;
  --brand-soft: #e8edff;
  --bg: #f7f8fc;
  --surface: #ffffff;
  --ink: #141a2e;
  --muted: #59617a;
  --line: #e1e5f0;
  --radius: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #7d97ff;
    --brand-ink: #0b1030;
    --brand-soft: #1c2448;
    --bg: #0e1120;
    --surface: #161a2c;
    --ink: #e9ecf8;
    --muted: #a3aac2;
    --line: #262c45;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

/* Language: Romanian unless the page is switched to English. */
html.en .ro, html:not(.en) .en { display: none !important; }

a { color: var(--brand); }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }

header.top {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
header.top .wrap {
  display: flex; align-items: center; gap: 12px;
  min-height: 60px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px;
}
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.spacer { flex: 1; }

.lang {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
}
.lang button {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 14px; font-weight: 600; padding: 4px 12px; cursor: pointer;
}
html:not(.en) .lang [data-lang="ro"], html.en .lang [data-lang="en"] {
  background: var(--brand); color: var(--brand-ink);
}

/* Home */
.hero { padding: 56px 0 32px; text-align: center; }
.hero img { width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 10px 30px rgb(36 71 224 / .25); }
.hero h1 { font-size: clamp(32px, 6vw, 48px); line-height: 1.1; margin: 20px 0 8px; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 600px; margin: 0 auto; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; text-decoration: none;
}
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.ghost { border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.btn[aria-disabled="true"] { opacity: .6; pointer-events: none; }

.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  padding: 24px 0 8px;
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card .ic {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 12px;
}
.card .ic svg { width: 22px; height: 22px; }

.band {
  margin: 32px 0; padding: 24px; border-radius: var(--radius);
  background: var(--brand-soft);
}
.band h2 { margin: 0 0 8px; font-size: 22px; }
.band p { margin: 0; }

/* Text pages */
.doc { padding: 40px 0 24px; max-width: 720px; }
.doc h1 { font-size: clamp(28px, 5vw, 38px); line-height: 1.15; margin: 0 0 6px; }
.doc .meta { color: var(--muted); margin: 0 0 28px; }
.doc h2 { font-size: 21px; margin: 32px 0 8px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 4px 0; }
.doc .summary {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: 12px; padding: 16px 20px;
}
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.doc .table { overflow-x: auto; }
code { font-size: .92em; background: var(--brand-soft); padding: 1px 5px; border-radius: 5px; }

footer {
  border-top: 1px solid var(--line); margin-top: 48px;
  color: var(--muted); font-size: 14px;
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-top: 20px; padding-bottom: 28px; }
footer a { color: var(--muted); }
