/* PEC — South Grove Trading
   Sistema visual propio. Sin framework: el sitio pesa lo que se ve.
   Tipografía de sistema — sin fuentes remotas, sin FOUT, sin pedidos a terceros. */

:root {
  /* Tinta */
  --ink:        #0d1520;
  --ink-2:      #3d4856;
  --ink-3:      #6b7784;
  --ink-4:      #9aa4b0;

  /* Superficies */
  --bg:         #ffffff;
  --bg-2:       #f7f9fb;
  --bg-deep:    #0d1520;

  /* Líneas */
  --line:       #e4e9ee;
  --line-2:     #cfd7e0;
  --line-dark:  #22303f;

  /* Acento: azul de carta náutica */
  --accent:     #14568f;
  --accent-2:   #1b6db4;
  --accent-pale:#eaf2fa;

  /* Métrica */
  --measure:    68ch;
  --gutter:     clamp(20px, 5vw, 40px);
  --section:    clamp(64px, 10vw, 120px);

  --radius:     10px;
  --ease:       cubic-bezier(.22, .61, .36, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .serif {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
               Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -.011em;
  line-height: 1.18;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(34px, 5.4vw, 56px); }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
h3 { font-size: clamp(18px, 2vw, 21px); line-height: 1.35; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }

/* ---------- Estructura ---------- */

.shell { max-width: 1120px; margin: 0 auto; padding-inline: var(--gutter); }
.narrow { max-width: 780px; }

/* .narrow sobre el propio .shell no debe reducir el contenedor: eso lo recentra y
   la sección queda con un borde izquierdo distinto al de las demás. Se conserva el
   ancho del shell y se acota la medida de lectura de sus hijos, así todas las
   secciones arrancan en la misma vertical. */
.shell.narrow { max-width: 1120px; }
.shell.narrow > * { max-width: 780px; }

section { padding-block: var(--section); }
section + section { border-top: 1px solid var(--line); }

.eyebrow {
  display: block;
  margin-bottom: 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede {
  font-size: clamp(18px, 2.1vw, 21px);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: var(--measure);
}

.muted { color: var(--ink-3); }
.small { font-size: 14px; line-height: 1.55; }

/* ---------- Barra superior ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .shell {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; height: 66px;
}
.brand {
  display: flex; align-items: baseline; gap: 10px;
  text-decoration: none; color: var(--ink);
}
.brand b { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.brand span { font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); }
.navlinks { display: flex; gap: 26px; align-items: center; }
.navlinks a {
  font-size: 14.5px; color: var(--ink-2); text-decoration: none;
  transition: color .18s var(--ease);
}
.navlinks a:hover { color: var(--ink); }
@media (max-width: 860px) { .navlinks a:not(.btn) { display: none; } }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(58px, 9vw, 110px) var(--section); }
.hero h1 { max-width: 23ch; }
.hero .lede { margin-top: 26px; }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 10px 30px;
  margin-top: 40px; padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--ink-3);
}
.hero-meta b { color: var(--ink); font-weight: 600; }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 550;
  text-decoration: none; cursor: pointer;
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); color: #fff; transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: #fff; }
.btn-ghost:hover { border-color: var(--ink-4); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* ---------- Grillas ---------- */

.grid { display: grid; gap: clamp(22px, 3vw, 34px); }
/* 360px es deliberado: con el contenedor de 1120 no entran tres columnas, así que
   los bloques de cuatro tarjetas caen en 2x2 en lugar de 3+1 huérfana. */
.g2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--ink-2); font-size: 15.5px; }
.card .step {
  display: block; margin-bottom: 14px;
  font-size: 12px; font-weight: 650; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
}

/* ---------- Cita normativa ---------- */

.statute {
  margin-top: 30px;
  padding: 22px 26px;
  background: var(--bg-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.statute blockquote {
  margin: 0 0 12px;
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 16.5px; line-height: 1.6; color: var(--ink);
}
.statute cite { font-style: normal; font-size: 13px; color: var(--ink-3); }

/* ---------- Lista de requisitos ---------- */

.reqs { list-style: none; margin: 30px 0 0; padding: 0; counter-reset: r; }
.reqs li {
  position: relative;
  padding: 20px 0 20px 52px;
  border-bottom: 1px solid var(--line);
  counter-increment: r;
}
.reqs li:last-child { border-bottom: 0; }
.reqs li::before {
  content: counter(r);
  position: absolute; left: 0; top: 19px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-pale); color: var(--accent);
  font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.reqs b { display: block; margin-bottom: 3px; }
.reqs span { color: var(--ink-2); font-size: 15.5px; }

/* ---------- Tabla ---------- */

.tablewrap { overflow-x: auto; margin-top: 28px; }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- Precio ---------- */

.price { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 12px; }
.price .amount {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 38px; font-weight: 600; letter-spacing: -.02em;
}
.price .unit { color: var(--ink-3); font-size: 15px; }

/* ---------- Formulario ---------- */

.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 550; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 15.5px;
  color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: 8px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field textarea { min-height: 108px; resize: vertical; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-pale);
}
.field .hint { margin-top: 6px; font-size: 13px; color: var(--ink-3); }

.notice {
  padding: 14px 16px; border-radius: 8px; font-size: 15px; margin-bottom: 22px;
  border: 1px solid;
}
.notice-ok  { background: #f0f8f2; border-color: #c9e4d1; color: #1d5c32; }
.notice-err { background: #fdf2f2; border-color: #f0cfcf; color: #8c2a2a; }

/* Trampa para bots: invisible para personas, irresistible para scripts. */
.gotcha { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Pie ---------- */

.footer { background: var(--bg-deep); color: #b9c4d0; padding-block: 56px 44px; }
.footer a { color: #dbe4ed; }
.footer h4 { margin: 0 0 12px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #7b8a99; font-weight: 600; }
.footer p { font-size: 15px; }
.footer .fine {
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid var(--line-dark);
  font-size: 13px; color: #7b8a99;
}

/* ---------- Revelado al scroll ---------- */

/* El contenido es visible POR DEFECTO. Solo se oculta si hay JavaScript, y para eso
   un script en línea marca <html class="js"> antes de pintar.

   Sin esta condición la página arranca en opacity:0 y depende del JS para poder
   leerse: quien lo tenga bloqueado, un crawler o un lector con red lenta ven una
   pantalla en blanco. La animación tiene que ser un agregado, no un requisito. */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.in {
  opacity: 1; transform: none;
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}

/* Si el sistema pide menos movimiento, no hay ninguno: ni revelado, ni
   desplazamiento en hover, ni scroll suave. La animación refuerza la lectura;
   nunca es requisito para entender la página. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .card:hover { transform: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* =========================================================================
   PORTAL
   ========================================================================= */

.portal .topbar .navlinks { gap: 16px; }

.empty {
  margin-top: 36px; padding: 44px 30px; text-align: center;
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  background: var(--bg-2);
}
.empty h3 { margin-bottom: 8px; }
.empty p { max-width: 46ch; margin-inline: auto; font-size: 15.5px; }

/* --- Legajo: un capitán y sus certificados --- */

.legajo {
  margin-top: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.legajo-head {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 20px 24px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.legajo-head h2 { font-size: 20px; }
.legajo-head p { margin: 3px 0 0; }
.legajo-head .count {
  flex: none; font-size: 13px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* --- Fila de certificado --- */

.cert {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 20px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
  transition: background .16s var(--ease);
}
.cert:last-child { border-bottom: 0; }
.cert:hover { background: var(--accent-pale); color: inherit; }
.cert-leg { font-weight: 600; font-size: 16px; }
.cert-sub { margin-top: 3px; }

.cert-progress { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.bar {
  width: 92px; height: 6px; border-radius: 999px;
  background: var(--line); overflow: hidden;
}
.bar span {
  display: block; height: 100%; border-radius: 999px;
  background: var(--accent);
  transition: width .5s var(--ease);
}

.cert-flags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.chip {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
  border: 1px solid transparent; white-space: nowrap;
}
.chip.grey  { background: #f1f3f6; color: #5b6472; border-color: #e2e6ec; }
.chip.blue  { background: var(--accent-pale); color: var(--accent); border-color: #cfe0f0; }
.chip.green { background: #eef7f1; color: #1d5c32; border-color: #cfe6d8; }
.chip.amber { background: #fdf6e8; color: #8a5d09; border-color: #f0e0bd; }
.chip.red   { background: #fdf1f1; color: #8c2a2a; border-color: #f0cfcf; }

@media (max-width: 720px) {
  .cert { grid-template-columns: 1fr; gap: 12px; }
  .cert-flags { justify-content: flex-start; }
  .cert-progress { min-width: 0; }
}

/* --- Detalle del certificado --- */

.checklist { margin-top: 30px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chk {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 16px;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.chk:last-child { border-bottom: 0; }
.chk-mark {
  width: 22px; height: 22px; border-radius: 50%; margin-top: 2px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  border: 1px solid var(--line-2); color: var(--ink-4);
}
.chk.ok  .chk-mark { background: #eef7f1; border-color: #cfe6d8; color: #1d5c32; }
.chk.obs .chk-mark { background: #fdf6e8; border-color: #f0e0bd; color: #8a5d09; }
.chk b { display: block; font-size: 15.5px; }
.chk .desc { margin-top: 4px; font-size: 14.5px; color: var(--ink-2); }
.chk .legal { margin-top: 6px; font-size: 12.5px; color: var(--ink-4); }
.chk .obsnote {
  margin-top: 10px; padding: 10px 12px; border-radius: 8px;
  background: #fdf6e8; border: 1px solid #f0e0bd; color: #7a5208; font-size: 14px;
}
.pieces { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* --- Línea de tiempo --- */

.timeline { margin-top: 14px; padding-left: 18px; border-left: 2px solid var(--line); }
.timeline li { list-style: none; position: relative; padding: 0 0 18px 16px; }
.timeline li::before {
  content: ''; position: absolute; left: -25px; top: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line-2);
}
.timeline b { font-size: 14.5px; }
.timeline time { display: block; font-size: 12.5px; color: var(--ink-4); margin-top: 2px; }

/* --- Resumen de elegibilidad --- */

.rules { margin-top: 22px; display: grid; gap: 10px; }
.rule {
  display: flex; align-items: baseline; gap: 12px;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14.5px;
}
.rule .mark { font-weight: 700; }
.rule.ok   .mark { color: #1d5c32; }
.rule.bad  .mark { color: #8c2a2a; }
.rule .val { margin-left: auto; color: var(--ink-3); font-variant-numeric: tabular-nums; }
