/* Pașaport sau buletin — border-desk instrument. All colour via vars. */
:root {
  --paper: #f5f0e2;
  --paper-2: #ece4d0;
  --card: #faf7ec;
  --ink: #201b11;
  --ink-soft: #57503d;
  --line: #d8cdae;
  --brass: #7d5f22;
  --brass-soft: #a68c4a;
  --yes: #14663a;
  --yes-bg: #e2efe2;
  --no: #a4201a;
  --no-bg: #f6e2dd;
  --stamp-yes: #14663a;
  --stamp-no: #a4201a;
  --focus: #0f5fd0;
  --shadow: 0 1px 0 rgba(32, 27, 17, 0.08), 0 10px 30px -18px rgba(32, 27, 17, 0.45);
  --radius: 14px;
}
[data-theme="dark"] {
  --paper: #14110a;
  --paper-2: #1c1810;
  --card: #1e1a11;
  --ink: #ece3cd;
  --ink-soft: #b3a888;
  --line: #453c26;
  --brass: #c9a24a;
  --brass-soft: #8a6f33;
  --yes: #58c581;
  --yes-bg: #14301f;
  --no: #e0705f;
  --no-bg: #3a1d18;
  --stamp-yes: #58c581;
  --stamp-no: #e0705f;
  --focus: #7fb3ff;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.4), 0 12px 32px -18px rgba(0, 0, 0, 0.8);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 26px 26px;
}
[data-theme="dark"] body { background-image: radial-gradient(#26200f 1px, transparent 1px); }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
svg[hidden] { display: none; }
[hidden] { display: none !important; }
a { color: var(--brass); }
[data-theme="dark"] a { color: var(--brass); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ——— topbar ——— */
.topbar {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.65rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  position: sticky; top: 0; z-index: 20;
}
.home { font-weight: 800; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); font-size: 1.02rem; }
.topnav { display: flex; gap: 0.15rem; flex-wrap: wrap; }
.topnav a { color: var(--ink-soft); text-decoration: none; padding: 0.2rem 0.55rem; border-radius: 8px; font-size: 0.92rem; }
.topnav a:hover { background: var(--paper-2); color: var(--ink); }
.spacer { flex: 1; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.7rem;
  font-size: 0.82rem; text-decoration: none; color: var(--ink-soft); background: var(--paper);
}
.chip:hover { color: var(--ink); border-color: var(--brass-soft); }
.icon-btn {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: 10px; width: 2.1rem; height: 2.1rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--brass-soft); }

main { max-width: 62rem; margin: 0 auto; padding: 0 1.1rem 4rem; }
section { margin-top: 3.2rem; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.12; letter-spacing: -0.015em; }
h2 { font-size: 1.75rem; margin: 0 0 0.6rem; }
h2 .no { color: var(--brass); font-family: ui-monospace, monospace; font-size: 1rem; letter-spacing: 0.08em; display: block; margin-bottom: 0.3rem; }
.lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 44rem; }
.deck strong { color: var(--ink); }

/* ——— hero ——— */
.hero { padding: 3rem 0 0.5rem; max-width: 48rem; }
.kicker {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--brass); margin: 0 0 0.9rem;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.9rem); margin: 0 0 1rem; }
.hero h1 .amp { color: var(--brass); }
.deck { font-size: 1.16rem; color: var(--ink-soft); margin: 0 0 1rem; }
.answer-line {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.98rem; background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--brass); border-radius: 10px;
  padding: 0.8rem 1rem; margin: 0; box-shadow: var(--shadow);
}
.answer-line .yes-t { color: var(--yes); font-weight: 700; }
.answer-line .no-t { color: var(--no); font-weight: 700; }
.share-wa { margin: 0.7rem 0 0; font-size: 0.9rem; }
.share-wa a { color: var(--ink-soft); }
.share-wa a:hover { color: var(--ink); }

/* ——— checker panel ——— */
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(1.1rem, 3vw, 2rem);
  display: grid; gap: 1.4rem;
}
.panel-head { display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 1.4rem; }
.panel-head .queue {
  font-family: ui-monospace, monospace; font-size: 0.78rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--brass);
  border: 1px dashed var(--brass-soft); border-radius: 8px; padding: 0.2rem 0.6rem;
}
.field label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
.combo { position: relative; }
#tara-in {
  width: 100%; font-size: 1.25rem; font-family: Georgia, serif;
  padding: 0.7rem 1rem; border-radius: 12px;
  border: 2px solid var(--line); background: var(--paper); color: var(--ink);
}
#tara-in:focus { border-color: var(--brass); outline: none; box-shadow: 0 0 0 3px var(--paper-2); }
.hint { font-size: 0.88rem; color: var(--ink-soft); margin: 0.45rem 0 0; }
.tara-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  max-height: 19rem; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 0.35rem;
  display: none;
}
.combo:focus-within .tara-list { display: block; }
.opt-group {
  font-family: ui-monospace, monospace; font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--brass);
  padding: 0.55rem 0.7rem 0.25rem;
}
.opt {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.5rem 0.7rem; border-radius: 8px; cursor: pointer;
}
.opt span:first-child { font-weight: 600; }
.opt-stay { font-size: 0.8rem; color: var(--ink-soft); text-align: right; }
.opt.sel { background: var(--paper-2); }
.opt.cursor { background: var(--paper-2); box-shadow: inset 0 0 0 2px var(--brass-soft); }
.opt-empty { padding: 0.7rem; color: var(--ink-soft); }

/* doc cards */
.docs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; border: 0; margin: 0; padding: 0; }
.docs legend { font-weight: 700; padding: 0; margin-bottom: 0.6rem; }
.doc { position: relative; }
.doc input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.doc-card {
  display: block; height: 100%; border: 2px solid var(--line); border-radius: 12px;
  background: var(--paper); padding: 0.8rem; cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.doc input:checked + .doc-card { border-color: var(--brass); box-shadow: var(--shadow); }
.doc input:focus-visible + .doc-card { outline: 3px solid var(--focus); outline-offset: 2px; }
.doc-card:hover { transform: translateY(-2px); }
.spec {
  display: block;
  height: 4.6rem; border-radius: 8px; margin-bottom: 0.65rem; position: relative; overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--paper-2), var(--card) 55%, var(--paper-2));
}
.spec::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.35) 50%, transparent 58%);
}
[data-theme="dark"] .spec::after { background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.07) 50%, transparent 58%); }
.spec .photo {
  position: absolute; left: 0.55rem; top: 0.55rem; bottom: 0.55rem; width: 2.2rem;
  border-radius: 5px; background: var(--line);
}
.spec .ln { position: absolute; left: 3.2rem; height: 0.42rem; border-radius: 3px; background: var(--line); }
.spec .ln.a { top: 0.75rem; width: 45%; }
.spec .ln.b { top: 1.5rem; width: 32%; }
.spec .mrz { position: absolute; left: 0.55rem; right: 0.55rem; bottom: 0.45rem; height: 0.5rem;
  background: repeating-linear-gradient(90deg, var(--ink-soft) 0 2px, transparent 2px 5px); opacity: 0.55; }
.spec .chip-sq {
  position: absolute; left: 3.2rem; top: 2.25rem; width: 1.15rem; height: 0.9rem; border-radius: 3px;
  background: var(--brass); box-shadow: inset 0 0 0 2px var(--paper);
}
.spec .no-chip {
  position: absolute; right: 0.5rem; top: 0.45rem;
  font-family: ui-monospace, monospace; font-size: 0.62rem; letter-spacing: 0.1em;
  color: var(--no); border: 1px solid var(--no); border-radius: 5px; padding: 0.05rem 0.35rem;
  transform: rotate(4deg); background: var(--card);
}
.doc-name { display: block; font-weight: 800; font-size: 0.98rem; }
.doc-sub { display: block; font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.15rem; }
.doc input:checked + .doc-card .doc-name { color: var(--brass); }

/* euss toggle */
.euss {
  display: flex; gap: 0.7rem; align-items: flex-start;
  border: 1px dashed var(--brass-soft); border-radius: 12px; padding: 0.8rem 1rem;
  background: var(--paper);
}
.euss input { width: 1.2rem; height: 1.2rem; margin-top: 0.2rem; accent-color: var(--brass); flex: none; }
.euss span { font-size: 0.95rem; }

/* verdict */
.verdict {
  border-top: 2px solid var(--line); padding-top: 1.4rem;
  display: grid; gap: 0.9rem; justify-items: center; text-align: center;
}
.stamp {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800; font-size: clamp(1.15rem, 4vw, 1.7rem); letter-spacing: 0.06em;
  text-transform: uppercase; padding: 0.7rem 1.4rem;
  border: 4px double currentColor; border-radius: 12px;
  transform: rotate(-4deg);
  opacity: 0.94;
}
.stamp.yes { color: var(--stamp-yes); }
.stamp.no { color: var(--stamp-no); }
.stamp.slam { animation: slam 0.32s cubic-bezier(0.2, 2.4, 0.4, 1); }
@keyframes slam {
  0% { transform: rotate(-4deg) scale(2.1); opacity: 0; }
  60% { transform: rotate(-4deg) scale(0.94); opacity: 1; }
  100% { transform: rotate(-4deg) scale(1); opacity: 1; }
}
.verdict-head { font-size: 1.12rem; margin: 0; max-width: 40rem; }
.verdict-stay { margin: 0; font-size: 1rem; }
.verdict-stay .k { font-weight: 700; }
.verdict-note, .verdict-warn {
  margin: 0; font-size: 0.95rem; max-width: 42rem;
  border-radius: 10px; padding: 0.6rem 0.9rem;
}
.verdict-note { background: var(--paper-2); }
.verdict-warn { background: var(--no-bg); color: var(--ink); border: 1px solid var(--no); }
.verdict-src { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }
.copy-row { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  border: 2px solid var(--brass); background: transparent; color: var(--brass);
  border-radius: 10px; padding: 0.45rem 1rem;
}
.btn:hover { background: var(--brass); color: var(--paper); }
.copy-status { font-size: 0.88rem; color: var(--ink-soft); min-height: 1.4em; }

/* ——— CEI vs CIS ——— */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.2rem; }
.idcard {
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--card);
  box-shadow: var(--shadow); padding: 1.2rem; position: relative; overflow: hidden;
}
.idcard.cei { border-color: var(--yes); }
.idcard.cis { border-color: var(--no); }
.idcard .tag {
  display: inline-block; font-family: ui-monospace, monospace; font-weight: 800;
  font-size: 0.85rem; letter-spacing: 0.1em; border-radius: 8px; padding: 0.2rem 0.6rem;
  margin-bottom: 0.7rem;
}
.idcard.cei .tag { background: var(--yes-bg); color: var(--yes); }
.idcard.cis .tag { background: var(--no-bg); color: var(--no); }
.idcard h3 { margin: 0 0 0.4rem; font-size: 1.3rem; }
.idcard p { margin: 0.4rem 0; }
.idcard ul { margin: 0.6rem 0 0; padding-left: 1.2rem; }
.idcard li { margin: 0.25rem 0; }
.idcard .spec { height: 5.4rem; }
.ribbon {
  position: absolute; top: 0.95rem; right: -1.9rem; transform: rotate(35deg);
  background: var(--no); color: #fff; font-family: ui-monospace, monospace;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em;
  padding: 0.25rem 1.7rem;
}
.share-line {
  margin-top: 1.2rem; border-left: 4px solid var(--brass);
  background: var(--card); border-radius: 0 10px 10px 0;
  padding: 0.9rem 1.1rem; font-family: Georgia, serif; font-size: 1.08rem;
  box-shadow: var(--shadow);
}

/* ——— matrix ——— */
.matrix-tools { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }
.pill {
  font: inherit; font-size: 0.86rem; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
  border-radius: 999px; padding: 0.3rem 0.85rem;
}
.pill[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
#matrix-search {
  font: inherit; font-size: 0.95rem; padding: 0.45rem 0.8rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  margin-left: auto; min-width: min(16rem, 100%);
}
.matrix-count { font-size: 0.86rem; color: var(--ink-soft); margin: 0.2rem 0 0.6rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
table.matrix { border-collapse: collapse; width: 100%; font-size: 0.92rem; min-width: 46rem; }
.matrix thead th {
  position: sticky; top: 0; background: var(--paper-2);
  text-align: left; padding: 0.65rem 0.8rem; border-bottom: 2px solid var(--line);
  font-family: ui-monospace, monospace; font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.matrix tbody th { text-align: left; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--line); font-weight: 600; }
.matrix tbody td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--line); }
.matrix tbody tr:last-child th, .matrix tbody tr:last-child td { border-bottom: 0; }
.matrix tbody tr:hover { background: var(--paper-2); }
.grp { display: block; font-size: 0.74rem; color: var(--brass); font-weight: 400; }
.chip-da, .chip-nu {
  display: inline-block; font-family: ui-monospace, monospace; font-weight: 800; font-size: 0.8rem;
  border-radius: 7px; padding: 0.1rem 0.5rem;
}
.chip-da { background: var(--yes-bg); color: var(--yes); }
.chip-nu { background: var(--no-bg); color: var(--no); }
.matrix .stay { font-size: 0.84rem; color: var(--ink-soft); }
.matrix-fn { font-size: 0.88rem; color: var(--ink-soft); }

/* ——— faq / method ——— */
.faq details { border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin: 0.6rem 0; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; font-weight: 700; padding: 0.85rem 1.1rem; font-family: Georgia, serif; font-size: 1.05rem; }
.faq details p { padding: 0 1.1rem 1rem; margin: 0; color: var(--ink-soft); }
.faq details p strong { color: var(--ink); }
.method { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; box-shadow: var(--shadow); }
.method ul { margin: 0.5rem 0; padding-left: 1.2rem; }
.method li { margin: 0.35rem 0; }
.src-list { columns: 2; font-size: 0.9rem; }
footer.site {
  display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap;
  border-top: 1px solid var(--line); margin-top: 3.5rem; padding-top: 1.2rem;
  color: var(--ink-soft); font-size: 0.92rem;
}
footer.site a { color: var(--ink); }

@media (max-width: 40rem) {
  .docs { grid-template-columns: 1fr; }
  .duo { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .src-list { columns: 1; }
  #matrix-search { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .stamp { transform: rotate(-4deg); }
}
