/* E-Invoice Mandate Radar — Agilex+ Labs */
:root {
  --bg: #0D1F3C;
  --mid: #132A4F;
  --mid2: #1A3560;
  --line: rgba(234, 240, 248, 0.10);
  --line-strong: rgba(234, 240, 248, 0.18);
  --text: #EAF0F8;
  --muted: #9FB0C8;
  --amber: #E8A020;
  --amber-soft: rgba(232, 160, 32, 0.14);
  --blue: #1A5FB4;
  --blue-soft: rgba(26, 95, 180, 0.22);
  --green: #3FB68B;
  --red: #E06666;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

#wizard, #results { scroll-margin-top: 84px; }

body {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(26, 95, 180, 0.25), transparent 60%),
    radial-gradient(900px 480px at -10% 15%, rgba(232, 160, 32, 0.07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, .brand-name { font-family: "DM Sans", "Inter", sans-serif; letter-spacing: -0.01em; }

.wrap { width: min(1060px, 100% - 2.5rem); margin-inline: auto; }

.agx { color: var(--amber); font-weight: 600; }

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(13, 31, 60, 0.82);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; }
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-name { font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.brand-sub { font-size: 0.78rem; color: var(--muted); }
.header-badge {
  font-size: 0.75rem; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 0.3rem 0.75rem; white-space: nowrap;
}

/* ---------- panels ---------- */
main { flex: 1; padding: 2.2rem 0 3rem; }
.panel {
  background: linear-gradient(180deg, var(--mid), rgba(19, 42, 79, 0.6));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

/* ---------- intro ---------- */
.intro-panel { max-width: 780px; margin-inline: auto; text-align: center; padding: 3rem 2.2rem; }
.intro-panel h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); line-height: 1.2; margin-bottom: 1rem; }
.intro-panel h1 em { color: var(--amber); font-style: normal; }
.lede { color: var(--muted); max-width: 60ch; margin: 0 auto 1.6rem; }
.intro-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-bottom: 1.8rem; }
.point {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; color: var(--text);
  background: var(--blue-soft); border: 1px solid var(--line);
  padding: 0.42rem 0.85rem; border-radius: 999px;
}
.point-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.25rem; height: 1.25rem; border-radius: 50%;
  background: var(--amber); color: #14213a;
  font-weight: 700; font-size: 0.72rem;
}
.privacy-note { margin-top: 1rem; font-size: 0.8rem; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 10px; padding: 0.65rem 1.3rem;
  border: 1px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  text-decoration: none; display: inline-block;
}
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.btn-primary { background: var(--amber); color: #14213a; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(232, 160, 32, 0.35); }
.btn-lg { font-size: 1.05rem; padding: 0.85rem 1.9rem; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: rgba(234, 240, 248, 0.06); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.linklike {
  background: none; border: none; color: var(--amber); cursor: pointer;
  font: inherit; font-size: 0.85rem; text-decoration: underline; padding: 0;
}

/* ---------- wizard ---------- */
.wizard-panel { max-width: 720px; margin-inline: auto; }
.progress { height: 6px; border-radius: 999px; background: rgba(234, 240, 248, 0.08); overflow: hidden; margin-bottom: 0.8rem; }
.progress-bar { height: 100%; width: 25%; background: linear-gradient(90deg, var(--blue), var(--amber)); border-radius: 999px; transition: width 0.3s ease; }
.step-count { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.1rem; }
.step h2 { font-size: 1.45rem; margin-bottom: 0.4rem; }
.step-hint { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.4rem; }
.field-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.45rem; }

.select {
  width: 100%; font: inherit; color: var(--text);
  background: var(--mid2); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 0.75rem 0.9rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23EAF0F8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.9rem center;
}
.select:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.75rem; }
.choice {
  font: inherit; text-align: left; cursor: pointer; color: var(--text);
  background: var(--mid2); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 0.95rem 1.05rem;
  display: flex; flex-direction: column; gap: 0.2rem;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.choice:hover { border-color: var(--amber); }
.choice:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.choice[aria-pressed="true"], .choice[aria-checked="true"] {
  border-color: var(--amber);
  background: var(--amber-soft);
  box-shadow: inset 0 0 0 1px var(--amber);
}
.choice-title { font-weight: 600; }
.choice-desc { font-size: 0.82rem; color: var(--muted); }

.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.55rem; max-height: 45vh; overflow-y: auto; padding-right: 0.25rem; }
.country-chip {
  font: inherit; font-size: 0.88rem; cursor: pointer; color: var(--text);
  background: var(--mid2); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 0.55rem 0.7rem;
  display: flex; align-items: center; gap: 0.5rem;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.country-chip:hover { border-color: var(--amber); }
.country-chip:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.country-chip[aria-pressed="true"] { border-color: var(--amber); background: var(--amber-soft); box-shadow: inset 0 0 0 1px var(--amber); }
.chip-flag { font-size: 1.05rem; }
.chip-home { margin-left: auto; font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--amber); font-weight: 700; }

.wizard-nav { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 1.8rem; }

/* ---------- results ---------- */
.results { display: flex; flex-direction: column; gap: 1.4rem; }
.results-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.results-head h2 { font-size: 1.6rem; }
.results-sub { color: var(--muted); font-size: 0.92rem; margin-top: 0.2rem; }
.results-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }

.summary-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.8rem; }
.stat {
  background: linear-gradient(180deg, var(--mid), rgba(19, 42, 79, 0.55));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.05rem 1.2rem;
}
.stat-num { font-family: "DM Sans", sans-serif; font-size: 1.9rem; font-weight: 700; color: var(--amber); line-height: 1.1; }
.stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }
.stat.stat-urgent .stat-num { color: var(--red); }

/* timeline */
.timeline-panel h3, .action-panel h3, .cta-panel h3 { font-size: 1.2rem; margin-bottom: 1rem; }
.timeline { list-style: none; position: relative; padding-left: 1.6rem; }
.timeline::before {
  content: ""; position: absolute; left: 0.44rem; top: 0.4rem; bottom: 0.4rem;
  width: 2px; background: linear-gradient(180deg, var(--amber), var(--blue));
  border-radius: 2px;
}
.tl-item { position: relative; padding: 0 0 1.15rem 0.4rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -1.6rem; top: 0.42rem;
  width: 0.9rem; height: 0.9rem; border-radius: 50%;
  background: var(--bg); border: 2.5px solid var(--amber);
}
.tl-item.past::before { background: var(--amber); }
.tl-item.vida::before { border-color: var(--blue); }
.tl-date { font-family: "DM Sans", sans-serif; font-weight: 700; font-size: 0.95rem; color: var(--amber); }
.tl-date .tl-badge { margin-left: 0.4rem; }
.tl-what { font-size: 0.92rem; }
.tl-what strong { font-weight: 600; }
.tl-note { color: var(--muted); font-size: 0.82rem; }
.tl-badge {
  display: inline-block; font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  border-radius: 5px; padding: 0.1rem 0.42rem; vertical-align: 1px;
}
.tl-badge.live { background: rgba(224, 102, 102, 0.16); color: var(--red); }
.tl-badge.soon { background: var(--amber-soft); color: var(--amber); }
.tl-badge.later { background: var(--blue-soft); color: #7FB2EE; }

/* country cards */
.section-title { font-size: 1.2rem; }
#countryCards { display: grid; gap: 1rem; }
.ccard {
  background: linear-gradient(180deg, var(--mid), rgba(19, 42, 79, 0.55));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}
.ccard-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; margin-bottom: 0.4rem; }
.ccard-flag { font-size: 1.5rem; }
.ccard-name { font-family: "DM Sans", sans-serif; font-size: 1.15rem; font-weight: 700; }
.ccard-status {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  border-radius: 6px; padding: 0.18rem 0.55rem;
}
.st-live { background: rgba(224, 102, 102, 0.16); color: var(--red); }
.st-phasing, .st-adopted { background: var(--amber-soft); color: var(--amber); }
.st-planned, .st-partial { background: var(--blue-soft); color: #7FB2EE; }
.st-none { background: rgba(63, 182, 139, 0.14); color: var(--green); }
.ccard-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.9rem; }
.ccard-meta strong { color: var(--text); font-weight: 600; }
.ob { border-top: 1px solid var(--line); padding: 0.75rem 0; }
.ob:last-child { padding-bottom: 0; }
.ob-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; }
.ob-date { font-family: "DM Sans", sans-serif; font-weight: 700; color: var(--amber); font-size: 0.92rem; white-space: nowrap; }
.ob-title { font-weight: 600; font-size: 0.95rem; }
.ob-desc { color: var(--muted); font-size: 0.86rem; margin-top: 0.2rem; }
.ob.info .ob-date { color: #7FB2EE; }
.ccard-none { color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--line); padding-top: 0.75rem; }

/* actions */
.action-list { list-style: none; counter-reset: act; display: flex; flex-direction: column; gap: 0.8rem; }
.action-list li { counter-increment: act; display: flex; gap: 0.85rem; align-items: flex-start; }
.action-list li::before {
  content: counter(act);
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 1.55rem; height: 1.55rem; border-radius: 50%;
  background: var(--amber); color: #14213a; font-weight: 700; font-size: 0.8rem;
  margin-top: 0.1rem;
}
.action-list strong { font-weight: 600; }
.action-list .act-note { display: block; color: var(--muted); font-size: 0.85rem; }

.cta-panel { border-color: rgba(232, 160, 32, 0.4); text-align: left; }
.cta-panel p { color: var(--muted); font-size: 0.94rem; margin-bottom: 1.1rem; max-width: 68ch; }

.disclaimer { color: var(--muted); font-size: 0.78rem; max-width: 80ch; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 1.1rem 0; }
.site-footer p { font-size: 0.82rem; color: var(--muted); text-align: center; }
.site-footer a { color: var(--amber); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%) translateY(12px);
  background: var(--mid2); color: var(--text);
  border: 1px solid var(--amber); border-radius: 10px;
  padding: 0.6rem 1.1rem; font-size: 0.88rem;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* responsive */
@media (max-width: 640px) {
  .panel { padding: 1.4rem 1.2rem; }
  .intro-panel { padding: 2rem 1.3rem; }
  .header-badge { display: none; }
  .results-head { flex-direction: column; align-items: flex-start; }
  .country-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
}
@media (max-width: 380px) {
  body { font-size: 15px; }
  .wrap { width: calc(100% - 1.6rem); }
  .wizard-nav { flex-direction: column-reverse; }
  .wizard-nav .btn { width: 100%; }
}

/* print */
@media print {
  body { background: #fff; color: #111; }
  .site-header, .site-footer, .results-actions, .cta-panel, .wizard-panel, .intro-panel { display: none !important; }
  .panel, .ccard, .stat { background: #fff; border-color: #ccc; box-shadow: none; color: #111; }
  .stat-num, .tl-date, .ob-date { color: #8a5b00; }
  .ccard-name, .ob-title, .tl-what, .stat-label, .ccard-meta, .ob-desc, .tl-note, .results-sub, .disclaimer, .action-list .act-note { color: #222; }
  .timeline::before { background: #8a5b00; }
}
