/* css/base.css
   Estilos compartidos de CartaParaSanta.com: fuentes auto-alojadas, colores del prototipo,
   encabezado, botones, formularios y footer. Cada página añade lo suyo en su propio <style>. */

@font-face { font-family: 'Fraunces'; font-weight: 500; font-style: normal; font-display: swap; src: url('../assets/fonts/fraunces-500.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 700; font-style: normal; font-display: swap; src: url('../assets/fonts/fraunces-700.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 700; font-style: italic; font-display: swap; src: url('../assets/fonts/fraunces-700italic.woff2') format('woff2'); }
/* Solo tenemos Nunito 400 y 800: los 600/700 del prototipo usan la más cercana (800). */
@font-face { font-family: 'Nunito'; font-weight: 400 500; font-style: normal; font-display: swap; src: url('../assets/fonts/nunito-400.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 600 900; font-style: normal; font-display: swap; src: url('../assets/fonts/nunito-800.woff2') format('woff2'); }
@font-face { font-family: 'Patrick Hand'; font-weight: 400; font-style: normal; font-display: swap; src: url('../assets/fonts/patrickhand-400.woff2') format('woff2'); }
@font-face { font-family: 'Pinyon Script'; font-weight: 400; font-style: normal; font-display: swap; src: url('../assets/fonts/pinyonscript-400.woff2') format('woff2'); }

:root {
  --pino: #0F3324;
  --rojo: #B3261E;
  --rojo-hover: #9C2019;
  --rojo-sombra: #6E1611;
  --verde: #1F6B47;
  --dorado: #C9A24A;
  --dorado-claro: #E2C27A;
  --crema: #FBF7EF;
  --borde: #EADFC8;
  --texto: #1F2A24;
  --texto-2: #4B5550;
  --texto-3: #5A645F;
  --sobre-verde: #E9E2D0;
  --gris-verde: #C9D3CC;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--crema); color: var(--texto); font-family: 'Nunito', system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.5; }
img, svg { max-width: 100%; }
a { color: var(--rojo); }
a:hover { color: #8E1D17; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--dorado-claro); outline-offset: 2px; }
[hidden] { display: none !important; }
.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; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
@media (min-width: 700px) { .wrap { padding-left: 32px; padding-right: 32px; } }

/* ---------- Encabezado ---------- */
.site-header { background: #A53328; color: var(--crema); } /* rojo teja vivo, como el papel de las cartas */
.site-header .btn-rojo { background: #376A49; box-shadow: inset 0 0 0 2px rgba(255, 240, 215, 0.4); }
.site-header .btn-rojo:hover { background: #2D583C; color: #FFFFFF; }
/* Textos secundarios del encabezado más claros para que se lean bien sobre el rojo (contraste AA). */
.site-header .paso-btn, .site-header .seguro { color: #F6EDE0; }
.site-header .paso-btn.hecho { color: #FBE7B0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--crema); text-decoration: none; min-height: 44px; }
.logo:hover { color: var(--crema); }
.logo span { font-family: 'Fraunces', serif; font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.logo b { color: var(--dorado-claro); font-weight: 700; }
@media (min-width: 700px) { .logo span { font-size: 22px; } }
@media (max-width: 400px) { .logo span { font-size: 17px; } .logo svg { width: 26px; height: 26px; } }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px; font-weight: 800; font-size: 17px; text-decoration: none; line-height: 1.2; transition: background-color .15s, transform .15s; }
.btn-rojo { background: var(--rojo); color: #FFFFFF; }
.btn-rojo:hover { background: var(--rojo-hover); color: #FFFFFF; }
.btn-grande { min-height: 56px; padding: 0 30px; font-size: 19px; box-shadow: 0 6px 0 var(--rojo-sombra); }
.btn-grande:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--rojo-sombra); }
.btn-borde { background: #FFFFFF; color: var(--pino); border: 2px solid #E2D6BB; }
.btn-borde:hover { background: #F1EADB; color: var(--pino); }
.btn-verde { background: var(--verde); color: #FFFFFF; border-radius: 12px; }
.btn-verde:hover { background: #185839; color: #FFFFFF; }
.btn[disabled], .btn[aria-disabled="true"] { background: #9AA49F; color: #FFFFFF; box-shadow: none; cursor: not-allowed; pointer-events: none; }

/* ---------- Formularios ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 15px; color: var(--pino); }
.campo .opc { font-weight: 400; font-size: 13px; color: var(--texto-3); }
.campo input, .campo select, .campo textarea { width: 100%; font-size: 18px; font-weight: 400; color: var(--texto); padding: 12px 14px; border: 2px solid #E2D6BB; border-radius: 12px; background: #FFFFFF; min-height: 48px; }
.campo textarea { line-height: 1.5; resize: vertical; }
/* Safari pinta los select grises y más bajos: se igualan a los demás campos con flecha propia. */
.campo select { -webkit-appearance: none; appearance: none; padding-right: 40px; background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230F3324' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: 3px solid var(--dorado-claro); outline-offset: 1px; border-color: var(--dorado); }
.campo [aria-invalid="true"] { border-color: var(--rojo); }
.contador { font-weight: 400; font-size: 13px; color: var(--texto-3); align-self: flex-end; }
.contador.lleno { color: var(--rojo); font-weight: 800; }
.fila { display: flex; flex-wrap: wrap; gap: 14px; }
.fila > * { flex: 1 1 200px; min-width: 0; }

.aviso { border-radius: 14px; padding: 14px 16px; font-size: 15px; line-height: 1.5; }
.aviso-error { background: #FBE9E7; color: #7A1610; border: 1px solid #F0B9B3; }
.aviso-info { background: #FFF6DE; color: #5C4510; border: 1px solid #EBD39A; }
.aviso-ok { background: #E6F0EA; color: #154A31; border: 1px solid #B8D5C4; }

/* ---------- Footer ---------- */
.site-footer { background: var(--pino); color: var(--gris-verde); }
.site-footer .wrap { padding-top: 40px; padding-bottom: 40px; display: flex; flex-wrap: wrap; gap: 20px 24px; justify-content: space-between; align-items: center; font-size: 15px; }
.site-footer .marca { margin: 0; font-family: 'Fraunces', serif; font-weight: 700; font-size: 20px; color: var(--crema); }
.site-footer .marca b { color: var(--dorado-claro); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.site-footer nav a { color: var(--sobre-verde); display: inline-flex; align-items: center; min-height: 44px; }
.site-footer .legal { margin: 0; width: 100%; font-size: 13px; color: #A9B6AE; }

/* ---------- Páginas legales ---------- */
.legal-main { max-width: 760px; margin: 0 auto; padding: 36px 20px 80px; line-height: 1.65; }
.legal-main h1 { font-family: 'Fraunces', serif; font-weight: 700; font-size: clamp(30px, 6vw, 40px); line-height: 1.1; color: var(--pino); margin: 0 0 6px; }
.legal-main h2 { font-family: 'Fraunces', serif; font-weight: 700; font-size: 22px; color: var(--pino); margin: 34px 0 8px; }
.legal-main .fecha { color: var(--texto-3); font-size: 14px; margin: 0 0 24px; }
.legal-main li { margin-bottom: 6px; }
.legal-main table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 12px 0; }
.legal-main th, .legal-main td { border: 1px solid var(--borde); padding: 10px; text-align: left; vertical-align: top; }
.legal-main th { background: #F6F0E2; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
