/* cedula-e-panama.com — design system "editoriale premium"
   Direzione: studio legale internazionale / boutique immigration firm.
   Navy dominante, corallo solo per CTA e dettagli, gold come accento secondario. */

:root {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --surface-soft: #F1EEE7;

  --navy-950: #071B2C;
  --navy-900: #0B2438;
  --navy-800: #12334C;
  --navy-700: #1B4563;

  --blue-500: #2F6F9F;
  --blue-100: #DCEAF4;

  --coral-600: #B84345;
  --coral-500: #D35456;
  --coral-100: #F6DEDE;

  --gold-500: #B99A5B;
  --gold-100: #EFE7D6;

  --text: #17212B;
  --text-muted: #5C6670;
  --border: #D9D8D3;

  --container: 1240px;
  --article: 780px;

  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 12px;
  --radius-btn: 7px;
  --shadow: 0 8px 28px rgba(7, 27, 44, .05);
  --ease: 200ms ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.08rem;
  line-height: 1.72;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; }

/* ---------- links ---------- */

a {
  color: var(--navy-700);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size var(--ease), color var(--ease);
}
a:hover { color: var(--navy-900); background-size: 100% 1px; }

p a, li a, td a { background-size: 100% 1px; }
p a:hover, li a:hover, td a:hover { color: var(--coral-600); }

:focus-visible {
  outline: 2px solid var(--navy-700);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--gold-100); }

/* ---------- layout ---------- */

.container { width: min(100% - 3rem, var(--container)); margin-inline: auto; }
.content { max-width: var(--article); }

.skip-link {
  position: absolute;
  top: -120px;
  left: 1rem;
  z-index: 1000;
  padding: 0.7rem 1.1rem;
  color: #fff;
  background: var(--navy-950);
  border-radius: var(--radius-btn);
  font-weight: 600;
}
.skip-link:focus { top: 0.75rem; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(247, 245, 240, .94);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--border), 0 6px 18px rgba(7, 27, 44, .06); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 76px;
  transition: min-height var(--ease);
}
.site-header.is-scrolled .header-inner { min-height: 62px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--navy-950);
  font-family: var(--serif);
  font-size: 1.22rem;
  letter-spacing: 0.01em;
  background: none;
  white-space: nowrap;
}
.brand:hover { color: var(--navy-700); }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--navy-800);
  color: var(--navy-800);
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1;
  border-radius: 3px;
}

.header-nav-group { display: flex; align-items: center; gap: 1.5rem; }

.site-nav { display: flex; align-items: center; gap: 1.4rem; }
.site-nav a {
  padding: 0.4rem 0;
  color: var(--text-muted);
  font-size: 0.93rem;
  font-weight: 550;
  letter-spacing: 0.01em;
  background-image: linear-gradient(var(--coral-600), var(--coral-600));
  background-size: 0% 2px;
  background-position: 0 100%;
}
.site-nav a:hover { color: var(--navy-900); background-size: 100% 2px; }

.nav-toggle {
  display: none;
  padding: 0.5rem 0.85rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--navy-900);
  font: 600 0.9rem var(--sans);
  cursor: pointer;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-btn);
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  background-image: none;
  transition: background-color var(--ease), color var(--ease), border-color var(--ease), transform 150ms ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary { background-color: var(--coral-600); color: #fff; border: 1px solid var(--coral-600); }
.btn-primary:hover { background-color: #9d3739; border-color: #9d3739; color: #fff; }

.btn-secondary { background-color: transparent; color: var(--navy-800); border: 1px solid var(--navy-800); }
.btn-secondary:hover { background-color: var(--navy-950); border-color: var(--navy-950); color: #fff; }

.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.88rem; }

.btn-on-dark { background-color: var(--coral-500); border-color: var(--coral-500); color: #fff; }
.btn-on-dark:hover { background-color: var(--coral-600); border-color: var(--coral-600); color: #fff; }

/* ---------- typography ---------- */

h1, h2, h3, .serif { font-family: var(--serif); font-weight: 400; color: var(--navy-950); }

h1 {
  margin: 0 0 1.4rem;
  font-size: clamp(3.1rem, 6vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}
h1 .h1-sub {
  display: block;
  margin-top: 0.55rem;
  font-family: var(--sans);
  font-size: clamp(1.02rem, 1.6vw, 1.3rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--text-muted);
}

h2 {
  margin: 0 0 1.1rem;
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  scroll-margin-top: 6rem;
}

h3 {
  margin: 2rem 0 0.65rem;
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  line-height: 1.18;
  scroll-margin-top: 6rem;
}

h4 { margin: 1.5rem 0 0.5rem; font-size: 1.05rem; color: var(--navy-950); }

p { margin: 0 0 1.05rem; max-width: 70ch; }
ul, ol { margin: 0 0 1.2rem; padding-left: 1.3rem; max-width: 68ch; }
li { margin-bottom: 0.5rem; }
li::marker { color: var(--gold-500); }

.lead {
  margin: 0 0 1.6rem;
  max-width: 620px;
  font-size: clamp(1.18rem, 1.9vw, 1.38rem);
  line-height: 1.6;
  color: var(--text-muted);
}

.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin: 0 0 1.1rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow .num {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--gold-500);
}
.eyebrow::after {
  content: "";
  flex: 0 1 3.5rem;
  height: 1px;
  background: var(--border);
  transform: translateY(-0.28em);
}

.section-lead { max-width: 66ch; font-size: 1.13rem; color: var(--text-muted); }

/* ---------- sections / rhythm ---------- */

main section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
section.alt + section.alt { border-top: none; }

/* ---------- hero ---------- */

.hero {
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3rem, 6vw, 5rem);
  background: var(--bg);
}
.hero-grid {
  display: grid;
  grid-template-columns: 55fr 45fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero .eyebrow { color: var(--coral-600); }
.hero .eyebrow::after { background: var(--gold-500); opacity: .5; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 0 0 1.4rem; }

.trust-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.trust-line li { margin: 0; display: flex; align-items: center; gap: 0.6rem; }
.trust-line li + li::before { content: "·"; color: var(--gold-500); font-weight: 700; }

.hero-visual { position: relative; }
.hero-visual .visual-frame {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  line-height: 0;
}
.floating-card {
  position: absolute;
  left: -1.4rem;
  bottom: 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(7, 27, 44, .12);
}
.floating-card .brand-mark { width: 40px; height: 40px; font-size: 1.3rem; }
.floating-card strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.08rem;
  color: var(--navy-950);
  line-height: 1.2;
}
.floating-card span { font-size: 0.8rem; color: var(--text-muted); letter-spacing: 0.03em; }

/* ---------- "in breve" ---------- */

.keyfacts {
  padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.4rem, 3vw, 2.5rem);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy-800);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.keyfacts h2 { font-size: 1.05rem; font-family: var(--sans); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-800); margin-bottom: 1.1rem; }
.keyfacts ul {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: none;
  columns: 2;
  column-gap: 2.75rem;
}
.keyfacts li {
  break-inside: avoid;
  margin: 0 0 0.85rem;
  padding-left: 1.35rem;
  position: relative;
  font-size: 0.99rem;
}
.keyfacts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.55rem;
  height: 1px;
  background: var(--gold-500);
}

/* ---------- TOC ---------- */

.toc {
  padding: clamp(1.4rem, 3vw, 2rem) clamp(1.4rem, 3vw, 2.25rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.toc h2 { font-family: var(--sans); font-size: 0.9rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.9rem; }
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 3rem;
  counter-reset: toc;
  font-size: 0.95rem;
  max-width: none;
}
.toc li {
  counter-increment: toc;
  break-inside: avoid;
  margin: 0;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--surface-soft);
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--gold-500);
  min-width: 1.4rem;
}
.toc a { color: var(--navy-800); font-weight: 550; }

/* ---------- callouts ---------- */

.callout {
  margin: 1.5rem 0;
  padding: 1.15rem 1.35rem 1.2rem;
  max-width: 70ch;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.98rem;
}
.callout .callout-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.callout p { margin: 0; }
.callout p + p { margin-top: 0.5rem; }

.callout-info { background: var(--blue-100); border-left: 3px solid var(--blue-500); }
.callout-info .callout-label { color: var(--navy-700); }

.callout-warn { background: var(--coral-100); border-left: 3px solid var(--coral-600); }
.callout-warn .callout-label { color: var(--coral-600); }

.callout-note { background: var(--gold-100); border-left: 3px solid var(--gold-500); }
.callout-note .callout-label { color: #8a6f37; }

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  max-width: 1100px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 0.97rem; }
caption {
  padding: 0.9rem 1.15rem;
  text-align: left;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--navy-950);
  border-bottom: 1px solid var(--border);
}
th, td { padding: 0.8rem 1.15rem; text-align: left; vertical-align: top; }
thead th {
  background: var(--navy-900);
  color: #F2EFE9;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
tbody tr:nth-child(even) { background: rgba(241, 238, 231, 0.55); }
tbody tr + tr { border-top: 1px solid var(--surface-soft); }
tbody th { font-weight: 650; color: var(--navy-900); }

/* ---------- procedure timeline ---------- */

.steps { margin: 2rem 0 0.5rem; padding: 0; list-style: none; max-width: var(--article); counter-reset: step; }
.steps > li {
  position: relative;
  counter-increment: step;
  padding: 0 0 2.2rem 4.6rem;
}
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: -0.4rem;
  font-family: var(--serif);
  font-size: 2.15rem;
  line-height: 1;
  color: var(--gold-500);
}
.steps > li::after {
  content: "";
  position: absolute;
  left: 3.35rem;
  top: 0.35rem;
  bottom: 0.6rem;
  width: 1px;
  background: var(--border);
}
.steps > li:last-child { padding-bottom: 0.4rem; }
.steps > li:last-child::after { display: none; }
.steps h3 { margin: 0 0 0.45rem; font-size: 1.35rem; }
.steps p { margin: 0; font-size: 1rem; color: var(--text); }
.steps p + p { margin-top: 0.55rem; }

/* ---------- cost card ---------- */

.cost-card {
  margin: 1.75rem 0;
  max-width: 70ch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cost-card-head {
  padding: 1.1rem 1.5rem 1.2rem;
  background: var(--navy-950);
  color: #F2EFE9;
}
.cost-card-head .cost-kicker {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-500);
}
.cost-card-head strong { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; }
.cost-card-body { padding: 1.25rem 1.5rem 1.35rem; }
.cost-card-body p { margin: 0 0 0.6rem; font-size: 0.97rem; }
.cost-card-body p:last-child { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

/* ---------- FAQ ---------- */

.faq-list { max-width: 880px; border-top: 1px solid var(--border); }
.faq-list details { border-bottom: 1px solid var(--border); }
.faq-list summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.4rem 0.25rem;
  cursor: pointer;
  list-style: none;
  font-family: var(--serif);
  font-size: 1.18rem;
  color: var(--navy-950);
  transition: color var(--ease);
}
.faq-list summary:hover { color: var(--navy-700); }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  flex: none;
  font-family: var(--sans);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
  color: var(--coral-600);
  transition: transform 180ms ease;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list .faq-answer { padding: 0 2.5rem 1.4rem 0.25rem; }
.faq-list .faq-answer p { margin: 0 0 0.6rem; font-size: 1rem; color: var(--text); }
.faq-list .faq-answer p:last-child { margin-bottom: 0; }

/* ---------- sources ---------- */

.sources ul { max-width: 72ch; font-size: 0.97rem; }
.sources .updated {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  max-width: 72ch;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.updated-stamp {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-500);
}

/* ---------- CTA band ---------- */

.cta-band {
  padding: clamp(3.25rem, 7vw, 5.5rem) 0;
  background-color: var(--navy-950);
  background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 90px);
  color: #E9EEF3;
}
.cta-band h2 { color: #fff; max-width: 22ch; }
.cta-band p { color: #B9C6D1; max-width: 58ch; font-size: 1.1rem; }
.cta-band .cta-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.75rem; }
.cta-band .btn-secondary { color: #E9EEF3; border-color: rgba(233, 238, 243, 0.5); }
.cta-band .btn-secondary:hover { background: #fff; border-color: #fff; color: var(--navy-950); }
.cta-band a:not(.btn) { color: #fff; }

/* ---------- footer ---------- */

.site-footer {
  padding: clamp(2.5rem, 5vw, 3.75rem) 0 2rem;
  background: var(--navy-950);
  border-top: 1px solid var(--navy-800);
  color: #A8B4BF;
  font-size: 0.93rem;
}
.site-footer a { color: #DDE4EA; }
.site-footer a:hover { color: var(--gold-500); }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 2rem 2.5rem;
}
.site-footer h2 {
  margin: 0 0 0.8rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
}
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: 0.45rem; }
.site-footer p { max-width: none; }
.footer-brandline { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }
.footer-brandline .brand-mark { border-color: var(--gold-500); color: var(--gold-500); }
.footer-brandline strong { font-family: var(--serif); font-weight: 400; font-size: 1.15rem; color: #fff; }
.footer-note {
  margin-top: 2.25rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: 0.86rem;
}
.footer-note p { margin: 0; }
.footer-note .gov-note { color: #DDE4EA; font-weight: 600; }

/* ---------- legal pages / 404 ---------- */

.page-simple { padding: clamp(3rem, 7vw, 5rem) 0; }
.page-simple h1 { font-size: clamp(2.3rem, 4.5vw, 3.4rem); }
.page-simple h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-top: 2.25rem; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 560px; }
  .floating-card { left: 1rem; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .header-nav-group {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.5rem 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 14px 30px rgba(7, 27, 44, .08);
  }
  .site-header.nav-open .header-nav-group { display: flex; }
  .no-js .header-nav-group { display: flex; position: static; box-shadow: none; padding: 0 0 0.75rem; border: none; }
  .header-nav-group .site-nav { flex-direction: column; align-items: stretch; gap: 0; }
  .header-nav-group .site-nav a { padding: 0.7rem 0.25rem; border-bottom: 1px solid var(--surface-soft); font-size: 1rem; }
  .header-cta { margin-top: 0.9rem; text-align: center; }
  .no-js .header-nav-group .site-nav { flex-direction: row; flex-wrap: wrap; gap: 0 1rem; }
  .no-js .header-nav-group .site-nav a { border: none; }
}

@media (max-width: 720px) {
  .container { width: min(100% - 2.75rem, var(--container)); }
  .keyfacts ul, .toc ol { columns: 1; }
  .hero-ctas .btn { flex: 1 1 auto; text-align: center; }
  .steps > li { padding-left: 3.6rem; }
  .steps > li::before { font-size: 1.8rem; }
  .steps > li::after { left: 2.6rem; }
  table { min-width: 540px; font-size: 0.92rem; }
  .floating-card { position: static; margin-top: 0.9rem; }
}

@media (max-width: 390px) {
  .container { width: min(100% - 2.5rem, var(--container)); }
  h1 { font-size: clamp(2.85rem, 13vw, 3.35rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .btn:hover { transform: none; }
}

@media print {
  .site-header, .site-footer, .cta-band, .skip-link, .nav-toggle { display: none; }
  body { background: #fff; }
}
