/* =====================================================================
   SYNORIS — Sistema de diseño
   Paleta y tipografía extraídas del Manual del Modelo de Negocio v1.0
   ===================================================================== */

@import url('fonts.css');

/* ------------------------------------------------------------- tokens */
:root {
  /* Marca */
  --navy:        #0B1322;
  --navy-700:    #131d31;
  --navy-600:    #1c2942;
  --navy-500:    #2a3853;
  --gold:        #CDB78D;
  --gold-600:    #b89f70;
  --gold-100:    #f3ecdf;
  --graphite:    #2B2F36;
  --gray:        #6B7280;
  --gray-400:    #9aa1ac;
  --ivory:       #F7F5F1;
  --sand:        #F1EEE8;
  --sand-200:    #e8e4dd;
  --border:      #E8E4DD;
  --white:       #FFFFFF;

  /* Semánticos */
  --positive:    #2f6f4f;
  --positive-bg: #eaf3ee;
  --negative:    #9b3b3b;
  --negative-bg: #f8eded;
  --warning:     #8a6b2f;
  --warning-bg:  #fbf3e2;
  --info:        #2f5a7a;
  --info-bg:     #eaf1f6;

  /* Superficies */
  --bg:          var(--ivory);
  --surface:     var(--white);
  --surface-alt: var(--sand);
  --text:        var(--graphite);
  --text-strong: var(--navy);
  --text-muted:  var(--gray);

  /* Tipografía */
  --font-display: 'EB Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'SFMono-Regular', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  /* Escala fluida */
  --step--1: clamp(0.78rem, 0.76rem + 0.10vw, 0.84rem);
  --step-0:  clamp(0.94rem, 0.91rem + 0.14vw, 1.02rem);
  --step-1:  clamp(1.12rem, 1.05rem + 0.32vw, 1.32rem);
  --step-2:  clamp(1.38rem, 1.24rem + 0.66vw, 1.85rem);
  --step-3:  clamp(1.72rem, 1.45rem + 1.28vw, 2.65rem);
  --step-4:  clamp(2.10rem, 1.62rem + 2.30vw, 3.85rem);
  --step-5:  clamp(2.55rem, 1.75rem + 3.85vw, 5.40rem);

  /* Espaciado */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;  --sp-4: 1rem;
  --sp-5: 1.5rem;   --sp-6: 2rem;     --sp-7: 3rem;     --sp-8: 4rem;
  --sp-9: 6rem;     --sp-10: 8rem;

  /* Formas */
  --radius:    4px;
  --radius-lg: 8px;
  --radius-xl: 14px;

  --shadow-sm: 0 1px 2px rgba(11, 19, 34, .05);
  --shadow:    0 4px 16px rgba(11, 19, 34, .06);
  --shadow-lg: 0 18px 48px rgba(11, 19, 34, .10);

  --maxw:      1200px;
  --maxw-text: 68ch;

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

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  line-height: 1.65;
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 var(--sp-4);
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { margin: 0 0 var(--sp-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--navy); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--gold-600); }

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

::selection { background: var(--gold); color: var(--navy); }

/* ------------------------------------------------------------ layout */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2.5rem);
}
.container--narrow { max-width: 880px; }
.container--text   { max-width: 760px; }

.section { padding-block: clamp(3.5rem, 9vw, 7.5rem); }
.section--tight { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--dark {
  background: var(--navy);
  color: rgba(255, 255, 255, .78);
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--white); }
.section--alt { background: var(--sand); }

.stack > * + * { margin-top: var(--sp-4); }
.grid { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }

/* ------------------------------------------------------- tipografía UI */
.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-600);
  margin: 0 0 var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.eyebrow::before {
  content: '';
  width: 2rem;
  height: 1px;
  background: var(--gold);
  flex: none;
}
.eyebrow--center { justify-content: center; }
.section--dark .eyebrow { color: var(--gold); }

.lead {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: var(--maxw-text);
}
.section--dark .lead { color: rgba(255, 255, 255, .72); }

.display {
  font-family: var(--font-display);
  font-size: var(--step-5);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.muted { color: var(--text-muted); }
.small { font-size: var(--step--1); }
.mono  { font-family: var(--font-mono); font-size: .92em; letter-spacing: -.01em; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.pos { color: var(--positive); }
.neg { color: var(--negative); }

/* --------------------------------------------------------- separador */
.rule {
  border: 0;
  height: 1px;
  background: var(--border);
  margin-block: var(--sp-6);
}
.rule--ornament {
  height: auto;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  color: var(--gold);
}
.rule--ornament::before,
.rule--ornament::after {
  content: '';
  height: 1px;
  width: min(7rem, 18vw);
  background: linear-gradient(90deg, transparent, var(--gold));
}
.rule--ornament::after { background: linear-gradient(90deg, var(--gold), transparent); }
.rule--ornament span {
  width: 6px; height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
  flex: none;
}

/* ------------------------------------------------------------- botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: .82em 1.7em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  font-weight: 500;
  letter-spacing: .01em;
  cursor: pointer;
  text-align: center;
  transition: all .25s var(--ease);
  background: var(--navy);
  color: var(--white);
  line-height: 1.2;
}
.btn:hover { background: var(--navy-600); color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }

.btn--gold { background: var(--gold); color: var(--navy); }
.btn--gold:hover { background: var(--gold-600); color: var(--navy); }

.btn--ghost { background: transparent; color: var(--navy); border-color: var(--border); }
.btn--ghost:hover { background: var(--white); border-color: var(--navy); color: var(--navy); }

.btn--outline-light { background: transparent; color: var(--white); border-color: rgba(255,255,255,.3); }
.btn--outline-light:hover { background: rgba(255,255,255,.08); border-color: var(--gold); color: var(--white); }

.btn--sm  { padding: .5em 1.05em; font-size: var(--step--1); }
.btn--lg  { padding: 1em 2.2em; font-size: var(--step-1); }
.btn--block { display: flex; width: 100%; }
.btn--danger { background: var(--negative); }
.btn--danger:hover { background: #7f2f2f; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* ------------------------------------------------------------- tarjetas */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.35rem, 3vw, 2rem);
}
.card--flat { box-shadow: none; }
.card--pad-lg { padding: clamp(1.75rem, 4vw, 3rem); }
.card__title {
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--sp-3);
}

/* Cifra destacada */
.stat { display: flex; flex-direction: column; gap: var(--sp-1); }
.stat__value {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}
.stat__label {
  font-size: var(--step--1);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}
.section--dark .stat__value { color: var(--white); }
.section--dark .stat__label { color: rgba(255,255,255,.55); }

/* --------------------------------------------------------------- avisos */
.notice {
  border-left: 3px solid var(--gold);
  background: var(--sand);
  padding: var(--sp-4) var(--sp-5);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.notice__title {
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--navy);
  margin: 0 0 var(--sp-2);
}
.notice--info     { border-color: var(--info);     background: var(--info-bg); }
.notice--warning  { border-color: var(--warning);  background: var(--warning-bg); }
.notice--positive { border-color: var(--positive); background: var(--positive-bg); }
.notice--danger   { border-color: var(--negative); background: var(--negative-bg); }

/* --------------------------------------------------------------- badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .3em .75em;
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: .03em;
  background: var(--sand);
  color: var(--graphite);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge--gold     { background: var(--gold-100); color: #7a6434; border-color: #e3d6bb; }
.badge--positive { background: var(--positive-bg); color: var(--positive); border-color: #cfe3d7; }
.badge--negative { background: var(--negative-bg); color: var(--negative); border-color: #eed6d6; }
.badge--warning  { background: var(--warning-bg); color: var(--warning); border-color: #ecdcb9; }
.badge--info     { background: var(--info-bg); color: var(--info); border-color: #cfdde8; }
.badge--dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: none;
}

/* --------------------------------------------------------------- tablas */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-0);
  min-width: 34rem;
}
.table th {
  text-align: left;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: var(--sand);
  white-space: nowrap;
}
.table td {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(205, 183, 141, .05); }
.table .right { text-align: right; }
.table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Comparativa "es / no es" */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.compare__head {
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--sand);
  border-bottom: 1px solid var(--border);
}
.compare__head--yes { color: var(--navy); }
.compare__head--no  { color: var(--negative); border-left: 1px solid var(--border); }
.compare__item {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--step-0);
}
.compare__item--no { border-left: 1px solid var(--border); color: var(--text-muted); }
.compare > .compare__item:nth-last-child(-n+2) { border-bottom: 0; }
.compare__mark { flex: none; margin-top: .12em; font-weight: 600; }
.compare__mark--yes { color: var(--gold-600); }
.compare__mark--no  { color: var(--negative); }
@media (max-width: 640px) {
  .compare { grid-template-columns: 1fr; }
  .compare__head--no, .compare__item--no { border-left: 0; }
}

/* ------------------------------------------------------------ formularios */
.field { margin-bottom: var(--sp-5); }
.field:last-child { margin-bottom: 0; }

.label {
  display: block;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}

.input, .select, .textarea {
  width: 100%;
  padding: .78em 1em;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--step-0);
  color: var(--text);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--gray-400); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(205, 183, 141, .22);
}
.input[readonly] { background: var(--sand); cursor: default; }
.textarea { min-height: 8rem; resize: vertical; line-height: 1.6; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236B7280' stroke-width='1.6' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.6rem;
}
.input--invalid { border-color: var(--negative); }
.field__error { color: var(--negative); font-size: var(--step--1); margin-top: var(--sp-2); }
.field__hint  { color: var(--text-muted); font-size: var(--step--1); margin-top: var(--sp-2); }

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  cursor: pointer;
  font-size: var(--step-0);
  line-height: 1.55;
}
.checkbox input[type="checkbox"] {
  appearance: none;
  width: 1.15rem; height: 1.15rem;
  flex: none;
  margin-top: .18em;
  border: 1px solid var(--gray-400);
  border-radius: 3px;
  background: var(--white);
  cursor: pointer;
  transition: all .2s var(--ease);
}
.checkbox input[type="checkbox"]:checked {
  background: var(--navy);
  border-color: var(--navy);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 5l3.2 3.2L11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.checkbox input[type="checkbox"]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.form-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }

/* --------------------------------------------------------------- flash */
.flash-stack {
  position: fixed;
  top: var(--sp-5);
  right: var(--sp-5);
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-width: min(26rem, calc(100vw - 2rem));
}
.flash {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--navy);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-lg);
  font-size: var(--step-0);
  animation: flashIn .45s var(--ease) both;
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
}
.flash--success { border-left-color: var(--positive); }
.flash--error   { border-left-color: var(--negative); }
.flash--warning { border-left-color: var(--warning); }
.flash--info    { border-left-color: var(--info); }
.flash__close {
  margin-left: auto; background: none; border: 0; cursor: pointer;
  color: var(--text-muted); font-size: 1.1rem; line-height: 1; padding: 0;
}
@keyframes flashIn { from { opacity: 0; transform: translateX(1.5rem); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ utilidades */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--navy); color: var(--white);
  padding: var(--sp-3) var(--sp-5);
}
.skip-link:focus { left: 0; color: var(--white); }

.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.flex-center { display: flex; align-items: center; gap: var(--sp-3); }
.gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); }
.mt-0 { margin-top: 0; }   .mt-4 { margin-top: var(--sp-4); }  .mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); } .mt-7 { margin-top: var(--sp-7); }
.mb-0 { margin-bottom: 0; } .mb-4 { margin-bottom: var(--sp-4); } .mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }
.w-full { width: 100%; }

/* --------------------------------------------------- animación al scroll */
.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal--d1 { transition-delay: .08s; }
.reveal--d2 { transition-delay: .16s; }
.reveal--d3 { transition-delay: .24s; }
.reveal--d4 { transition-delay: .32s; }

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

/* --------------------------------------------------------------- print */
@media print {
  .site-header, .site-footer, .btn, .flash-stack, .office-nav, .admin-nav { display: none !important; }
  body { background: #fff; }
  .card { border: 1px solid #ddd; box-shadow: none; }
}
