/* KAS Digital — shared foundation (brand C1, CLAUDE.md §7).
   Design tokens, self-hosted Unbounded + DM Sans, type scale, reset, links and
   buttons. Loaded by EVERY page. Change a token here and it changes site-wide. */

/* Variable fonts, latin subset, trimmed to the weights in use (Unbounded 600–800, DM Sans 400–700). SIL OFL 1.1 — see /assets/fonts/OFL.txt. */
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 600 800; font-display: swap; src: url('/assets/fonts/unbounded-v1.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/assets/fonts/dm-sans-v1.woff2') format('woff2'); }
/* Local Arial scaled to each web font's measured width and metrics, so the swap barely moves text (CLS). */
@font-face { font-family: 'Unbounded Fallback'; font-weight: 100 900; src: local('Arial Bold'), local('Arial-BoldMT'); size-adjust: 128%; ascent-override: 77.7%; descent-override: 19.1%; line-gap-override: 0%; }
@font-face { font-family: 'DM Sans Fallback'; font-weight: 100 600; src: local('Arial'), local('ArialMT'); size-adjust: 104%; ascent-override: 95.4%; descent-override: 29.8%; line-gap-override: 0%; }
@font-face { font-family: 'DM Sans Fallback'; font-weight: 700 1000; src: local('Arial Bold'), local('Arial-BoldMT'); size-adjust: 101.5%; ascent-override: 97.7%; descent-override: 30.5%; line-gap-override: 0%; }

:root {
  /* Colour — the complete C1 palette. No colours outside this list (§7). */
  --kas-black: #000000;      /* page background */
  --kas-red: #F9013F;        /* primary button (max 1–2 per screen), logo dot */
  --kas-wine: #6E001C;       /* supporting blocks, always white text */
  --kas-red-soft: #FF5A82;   /* link hover, focus ring, form errors */
  --kas-white: #FFFFFF;      /* headings, text on black/wine */
  --kas-grey-100: #EDEDED;   /* light blocks, black text */
  --kas-grey-300: #C9C9C9;   /* body text on black */
  --kas-grey-400: #A8A8A8;   /* meta, roles, footer */
  --kas-grey-600: #5C5C5C;   /* secondary button and form control borders */
  --kas-grey-700: #333333;   /* borders on black */
  --kas-grey-800: #1A1A1A;   /* cards/panels on black */
  --kas-btn-text: #000000;   /* text on red */
  --kas-red-hover: #FF1F55;  /* primary button hover (black text 5.6:1) */
  --kas-red-tint: #1C0B11;   /* selected chip/card surface */
  --kas-wine-tint: #14050A;  /* "no compensa" verdict surface */
  --kas-wine-text: #F2D9DF;  /* secondary text on wine (9.4:1) */
  --kas-surface-hover: #262626; /* hover surfaces and chart band */

  /* Spacing scale — every margin, padding and gap comes from here. */
  --kas-space-1: 0.25rem;  /*  4px */
  --kas-space-2: 0.5rem;   /*  8px */
  --kas-space-3: 0.75rem;  /* 12px */
  --kas-space-4: 1rem;     /* 16px */
  --kas-space-5: 1.5rem;   /* 24px */
  --kas-space-6: 2rem;     /* 32px */
  --kas-space-7: 3rem;     /* 48px */
  --kas-space-8: 4rem;     /* 64px */
  --kas-space-9: 6rem;     /* 96px */

  /* Shapes */
  --kas-radius-btn: 14px;    /* buttons, inputs */
  --kas-radius-card: 16px;   /* small cards, option cards, panels */
  --kas-radius-block: 26px;  /* portraits and large blocks */

  /* Type — Unbounded for headings, big numbers and the logo only; DM Sans for everything else. */
  --kas-font-head: 'Unbounded', 'Unbounded Fallback', 'Arial Black', sans-serif;
  --kas-font-body: 'DM Sans', 'DM Sans Fallback', system-ui, sans-serif;
  --kas-text-h1: clamp(2.25rem, 1.5rem + 3.2vw, 4rem);          /* 36 → 64px */
  --kas-text-h2: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);        /* 28 → 40px */
  --kas-text-h3: clamp(1.25rem, 1.17rem + 0.27vw, 1.375rem);    /* 20 → 22px */
  --kas-text-lead: clamp(1.125rem, 1.07rem + 0.25vw, 1.25rem);  /* 18 → 20px */
  --kas-text-body: clamp(1rem, 0.95rem + 0.15vw, 1.0625rem);    /* 16 → 17px */
  --kas-text-meta: 0.875rem;                                     /* 14px */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--kas-black); color: var(--kas-white); font-family: var(--kas-font-body); font-size: var(--kas-text-body); line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: inherit; text-decoration: none; }

/* Keyboard focus — visible on every page, every interactive element. */
:focus-visible { outline: 2px solid var(--kas-red-soft); outline-offset: 2px; }

/* Buttons — one definition for every page. The selector lists name the existing
   component classes (some are created by multistep-form.js), so markup and JS stay as they are.
   Primary: red with BLACK text (white on red fails AA, §7). Max 1–2 per screen. */
.kas-nav-cta, .kas-cta-hero, .kas-submit, .btn-accept, #kas-cookie-accept { display: inline-flex; align-items: center; justify-content: center; gap: var(--kas-space-2); min-height: 48px; padding: var(--kas-space-3) var(--kas-space-5); background: var(--kas-red); color: var(--kas-btn-text); font-family: var(--kas-font-body); font-size: 1rem; font-weight: 700; line-height: 1.25; text-align: center; border: 0; border-radius: var(--kas-radius-btn); cursor: pointer; }
.kas-nav-cta:hover, .kas-cta-hero:hover, .kas-submit:hover, .btn-accept:hover, #kas-cookie-accept:hover { background: var(--kas-red-hover); }
/* Secondary: 1.5px grey-600 border, white text. */
.kas-step-back, .kas-next-link, .back-link, .btn-reject, #kas-cookie-reject, #kas-cookie-config { display: inline-flex; align-items: center; justify-content: center; gap: var(--kas-space-2); min-height: 48px; padding: var(--kas-space-3) var(--kas-space-5); background: transparent; color: var(--kas-white); font-family: var(--kas-font-body); font-size: 1rem; font-weight: 700; line-height: 1.25; text-align: center; border: 1.5px solid var(--kas-grey-600); border-radius: var(--kas-radius-btn); cursor: pointer; }
.kas-step-back:hover, .kas-next-link:hover, .back-link:hover, .btn-reject:hover, #kas-cookie-reject:hover, #kas-cookie-config:hover { border-color: var(--kas-white); }
/* Primary CTA arrow (.kas-btn-arrow): nudges 4px on hover. */
.kas-btn-arrow { flex-shrink: 0; }
/* Press + hover feedback only — a direct response to the user (§7 Motion). */
@media (prefers-reduced-motion: no-preference) {
  .kas-nav-cta, .kas-cta-hero, .kas-submit, .btn-accept, #kas-cookie-accept,
  .kas-step-back, .kas-next-link, .back-link, .btn-reject, #kas-cookie-reject, #kas-cookie-config { transition: transform 150ms ease-out, background-color 200ms ease-out, border-color 200ms ease-out; }
  .kas-nav-cta:active, .kas-cta-hero:active, .kas-submit:active, .btn-accept:active, #kas-cookie-accept:active,
  .kas-step-back:active, .kas-next-link:active, .back-link:active, .btn-reject:active, #kas-cookie-reject:active, #kas-cookie-config:active { transform: scale(0.97); }
  .kas-btn-arrow { transition: transform 250ms cubic-bezier(0.2, 0.7, 0.2, 1); }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  :hover > .kas-btn-arrow { transform: translateX(4px); }
  :disabled > .kas-btn-arrow { transform: none; }
}
.kas-submit:disabled { opacity: 0.7; cursor: default; }

/* Headings: Unbounded, sentence case, never a single highlighted word (§7). */
h1, h2, h3, .kas-h1, .kas-h2 { font-family: var(--kas-font-head); color: var(--kas-white); text-wrap: balance; }
h1, .kas-h1 { font-size: var(--kas-text-h1); font-weight: 700; line-height: 1.08; letter-spacing: -1.5px; }
h2, .kas-h2 { font-size: var(--kas-text-h2); font-weight: 700; line-height: 1.12; letter-spacing: -1px; }
h3 { font-size: var(--kas-text-h3); font-weight: 600; line-height: 1.2; letter-spacing: -0.3px; }
p { max-width: 65ch; }

/* Text links: white and underlined (never colour alone); soft red on hover. */
.kas-content a, .kas-form-legal a, .phone-link a, #kas-cookie-inner p a { color: var(--kas-white); text-decoration: underline; text-underline-offset: 3px; }
.kas-content a:hover, .kas-form-legal a:hover, .phone-link a:hover, #kas-cookie-inner p a:hover { color: var(--kas-red-soft); }

/* Logo images: the SVG carries its own clear space; never recolour or stretch it. */
.kas-logo img, img.kas-footer-logo { display: block; width: auto; }

/* Skip link: first stop on every page, visible only when focused. */
.kas-skip { position: absolute; top: var(--kas-space-2); left: var(--kas-space-2); z-index: 10000; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--kas-space-4); background: var(--kas-red); color: var(--kas-btn-text); font-family: var(--kas-font-body); font-size: 1rem; font-weight: 700; border-radius: var(--kas-radius-btn); transform: translateY(-200%); }
.kas-skip:focus { transform: none; }
/* <main id="contenido" tabindex="-1"> receives focus from the skip link; no ring on the whole page. */
#contenido:focus { outline: none; }
