/* Portada de rielmo.es (#419, #434). Diseño: docs/diseno/flujos/portada.md.
   Colores = tokens de docs/diseno/sistema-de-diseno.md. Sin peticiones a terceros: la fuente va alojada aquí. */
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/portada/outfit-latin-wght.woff2") format("woff2"); }
  :root {
    --navy-950: #0a1520; --navy-900: #10202f; --navy-800: #172c40; --navy-700: #22394f;
    --navy-500: #4a6580; --navy-300: #9aacbe; --navy-200: #c5d1dc; --navy-100: #e3e9ef; --navy-50: #f3f6f9;
    --orange-500: #ff5b22; --orange-400: #ff7845; --orange-700: #b83508; --orange-50: #fff3ee;
    --white: #fff;
    --font-display: "Outfit", "Poppins", "Montserrat", "Avenir Next", "Century Gothic", "Segoe UI", system-ui, sans-serif;
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --gutter: clamp(16px, 5vw, 48px);
    --wrap: 1120px;
  }
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
  body { margin: 0; font: 400 1rem/1.55 var(--font-body); color: var(--navy-900); background: var(--navy-50); }
  img, svg { max-width: 100%; }
  a { color: var(--orange-700); }
  :focus-visible { outline: 3px solid var(--orange-400); outline-offset: 3px; border-radius: 4px; }
  .dark :focus-visible { outline-color: var(--orange-400); }
  .wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
  .skip { position: absolute; left: 8px; top: -80px; background: var(--white); color: var(--navy-900); padding: 12px 16px; border-radius: 8px; z-index: 50; font-weight: 600; }
  .skip:focus { top: 8px; }
  section[id] { scroll-margin-top: 112px; }

  h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0; letter-spacing: -0.02em; }
  h2 { font-size: clamp(1.75rem, 4.6vw, 2.5rem); font-weight: 700; margin-bottom: 12px; }
  h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 6px; line-height: 1.3; }
  p { margin: 0 0 1em; }
  .eyebrow { display: inline-block; margin: 0 0 14px; font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange-700); }
  .dark .eyebrow { color: var(--orange-400); }
  .lead { font-size: clamp(1.05rem, 2.4vw, 1.25rem); max-width: 40em; }

  /* Botones: mínimo 48 px de alto; naranja con texto navy (5,33:1) */
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 24px; border-radius: 14px; border: 2px solid transparent; font: 700 1.0625rem/1.2 var(--font-body); text-decoration: none; text-align: center; }
  .btn-primary { background: var(--orange-500); color: var(--navy-900); }
  .btn-primary:hover { background: var(--orange-400); }
  .btn-ghost { border-color: currentColor; color: inherit; }
  .btn-ghost:hover { background: rgba(255,255,255,.1); }
  .btn-dark { background: var(--navy-900); color: var(--white); }
  .btn-sm { min-height: 44px; padding: 8px 16px; font-size: 1rem; border-radius: 12px; }
  .lang-link { min-height: 48px; }
  .btn-block { width: 100%; }

  /* Cabecera fija */
  .site-header { position: sticky; top: 0; z-index: 30; background: var(--navy-900); color: var(--white); border-bottom: 1px solid rgba(255,255,255,.14); }
  .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
  .logo { display: block; height: 32px; width: auto; }
  .nav { display: flex; gap: 4px; padding-bottom: 8px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px; color: var(--white); text-decoration: none; font-weight: 600; font-size: .9375rem; }
  .nav a:hover { background: rgba(255,255,255,.12); }
  .site-header .nav-wrap { border-top: 1px solid rgba(255,255,255,.1); }

  /* Portada (oscura) */
  .dark { background: var(--navy-900); color: var(--white); }
  .hero { position: relative; overflow: hidden; padding: 40px 0 56px; }
  .hero .rails { position: absolute; right: -35vw; bottom: -18vw; width: 100vw; opacity: .9; pointer-events: none; }
  .rails .outer { fill: #fff; opacity: .05; }
  .rails .inner { fill: var(--orange-500); opacity: .2; }
  .hero-in { position: relative; display: grid; gap: 32px; }
  .hero h1 { font-size: clamp(2.5rem, 9vw, 4.25rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.03em; margin-bottom: 18px; }
  .hero h1 em { font-style: normal; white-space: nowrap; color: var(--orange-500); }
  .hero .lead { color: rgba(255,255,255,.88); margin-bottom: 24px; }
  .hero-cta { display: grid; gap: 12px; max-width: 460px; }
  .hero-note { margin: 16px 0 0; font-size: .9375rem; color: rgba(255,255,255,.78); max-width: 34em; }

  .route { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; max-width: 420px; }
  .stop { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; font: 700 1rem var(--font-display); }
  .stop.b { border-color: var(--orange-500); color: var(--orange-500); }
  .track { position: relative; height: 10px; border-top: 2px solid rgba(255,255,255,.25); border-bottom: 2px solid rgba(255,255,255,.25); }
  .track::after { content: ""; position: absolute; top: 50%; left: 0; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--orange-500); animation: travel 4.5s cubic-bezier(.6,0,.3,1) infinite; }
  .route-labels { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: .875rem; color: rgba(255,255,255,.78); }
  @keyframes travel { 0% { left: 0; opacity: 0; } 10% { opacity: 1; } 85% { left: calc(100% - 16px); opacity: 1; } 100% { left: calc(100% - 16px); opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .track::after { animation: none; left: calc(100% - 16px); } }

  /* Franja de garantías */
  .strip { background: var(--navy-800); color: var(--white); border-top: 1px solid rgba(255,255,255,.12); }
  .strip ul { list-style: none; margin: 0 auto; padding: 20px var(--gutter); display: grid; gap: 14px; }
  .strip li { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
  .strip svg { flex: 0 0 24px; width: 24px; height: 24px; color: var(--orange-500); margin-top: 1px; }
  .strip small { display: block; font-weight: 400; color: rgba(255,255,255,.8); font-size: .9375rem; }

  .section { padding: 56px 0; }
  .section.alt { background: var(--white); }
  .section-head { max-width: 44em; margin-bottom: 28px; }

  .cards { display: grid; gap: 16px; list-style: none; margin: 0; padding: 0; }
  .card { background: var(--white); border: 1px solid var(--navy-200); border-radius: 16px; padding: 20px; }
  .alt .card { background: var(--navy-50); }
  .card svg.ic { width: 32px; height: 32px; color: var(--orange-700); margin-bottom: 10px; }
  .card p { margin: 0; color: var(--navy-900); }

  /* Pasos */
  .steps { counter-reset: s; list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 16px; }
  .steps li { counter-increment: s; position: relative; padding: 0 0 0 60px; min-height: 44px; }
  .steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--navy-900); color: #fff; display: grid; place-items: center; font: 700 1.25rem var(--font-display); }
  .steps h3 { margin-top: 2px; }
  .steps p { margin: 0; }

  .notice { display: flex; gap: 12px; align-items: flex-start; background: var(--orange-50); border: 2px solid var(--navy-900); border-radius: 14px; padding: 16px 18px; margin: 0 0 28px; }
  .notice svg { flex: 0 0 24px; width: 24px; height: 24px; margin-top: 1px; }
  .notice p { margin: 0; }
  .two { display: grid; gap: 24px; }
  .checks { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
  .checks li { display: flex; gap: 10px; align-items: flex-start; }
  .checks svg { flex: 0 0 22px; width: 22px; height: 22px; color: var(--orange-700); margin-top: 2px; }
  .panel { background: var(--navy-900); color: #fff; border-radius: 20px; padding: 24px; }
  .panel h3 { font-size: 1.375rem; }
  .panel p { color: rgba(255,255,255,.88); }
  .panel .btn { margin-top: 4px; }

  /* Clientes */
  .who { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 8px; }
  .who li { background: var(--navy-100); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .9375rem; }
  .status { border-left: 6px solid var(--orange-500); background: var(--navy-50); border-radius: 0 14px 14px 0; padding: 16px 18px; margin-top: 24px; }
  .status p:last-child { margin-bottom: 0; } .status .btn { max-width: 100%; overflow-wrap: anywhere; }

  /* Preguntas */
  details { background: var(--white); border: 1px solid var(--navy-200); border-radius: 14px; margin-bottom: 10px; }
  summary { cursor: pointer; list-style: none; padding: 16px 52px 16px 18px; min-height: 52px; font-weight: 700; position: relative; border-radius: 14px; }
  summary::-webkit-details-marker { display: none; }
  summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font: 700 1.5rem/1 var(--font-display); color: var(--orange-700); }
  details[open] summary::after { content: "\2212"; }
  details p { padding: 0 18px 16px; margin: 0; }

  .final { text-align: left; }
  .final .hero-cta { margin-top: 18px; }

  /* Pie */
  footer { background: var(--navy-950); color: rgba(255,255,255,.86); padding: 40px 0 28px; font-size: .9375rem; }
  footer a { color: #fff; }
  .foot { display: grid; gap: 28px; }
  footer h2 { font: 700 .8125rem var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--navy-300); margin: 0 0 8px; }
  footer ul { list-style: none; margin: 0; padding: 0; }
  footer li a { display: inline-block; padding: 8px 0; }
  .legal-line { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.16); font-size: .875rem; color: var(--navy-300); }
  .legal-line a { color: #fff; }

  /* Barra fija de llamada en móvil */
  .sticky-cta { position: sticky; bottom: 0; z-index: 25; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: var(--navy-900); border-top: 1px solid rgba(255,255,255,.2); }
  .sticky-cta .btn { width: 100%; padding: 12px 6px; font-size: 1rem; }
  /* Dos entradas del mismo peso (D-109) */
  .entries { display: grid; gap: 16px; margin-top: 8px; }
  .entry { background: var(--navy-800); border: 1px solid rgba(255,255,255,.18); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
  .entry h2 { font-size: 1.5rem; margin: 0; }
  .entry p { margin: 0 0 8px; color: rgba(255,255,255,.88); flex: 1; }
  .entry small { display: block; margin-top: 10px; font-size: .9375rem; color: rgba(255,255,255,.78); }
  .entry .btn { margin-top: auto; }
  .hero-in.one { grid-template-columns: 1fr; }

  /* Formulario de interés */
  .split { display: grid; gap: 24px; }
  .form-card { background: var(--white); border: 2px solid var(--navy-900); border-radius: 20px; padding: 22px; }
  .form-card h3 { font-size: 1.5rem; margin-bottom: 6px; }
  .field { margin: 0 0 18px; }
  .field label, .field legend { display: block; font-weight: 700; margin-bottom: 6px; padding: 0; }
  .field .opt { font-weight: 400; color: var(--navy-500); }
  .field input[type=text], .field input[type=email], .field select { width: 100%; min-height: 52px; padding: 10px 14px; font: 400 1rem/1.3 var(--font-body); color: var(--navy-900); background: var(--white); border: 2px solid var(--navy-500); border-radius: 12px; }
  .field .hint { margin: 6px 0 0; font-size: .9375rem; color: var(--navy-700); }
  .field.invalid input, .field.invalid select { border-color: #b3261e; }
  .err { display: none; align-items: flex-start; gap: 8px; margin: 6px 0 0; color: #a3200a; font-weight: 600; font-size: .9375rem; }
  .err svg { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 1px; }
  .field.invalid .err { display: flex; }
  .consent { display: flex; gap: 12px; align-items: flex-start; }
  .consent input { flex: 0 0 28px; width: 28px; height: 28px; margin: 2px 0 0; accent-color: var(--navy-900); }
  .consent label { font-weight: 400; margin: 0; }
  .privacy-1 { background: var(--navy-50); border-radius: 12px; padding: 14px 16px; margin: 0 0 18px; font-size: .9375rem; }
  .privacy-1 p { margin: 0 0 6px; }
  .privacy-1 p:last-child { margin: 0; }
  .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
  .form-msg { display: none; gap: 12px; align-items: flex-start; border-radius: 14px; padding: 14px 16px; margin: 0 0 16px; font-weight: 600; }
  .form-msg svg { flex: 0 0 24px; width: 24px; height: 24px; margin-top: 1px; }
  .form-msg p { margin: 0; }
  .form-msg.is-error { background: #fdecea; border: 2px solid #a3200a; color: #6e1405; }
  .form-msg.is-offline { background: var(--orange-50); border: 2px solid var(--navy-900); }
  .form-msg.is-limit { background: var(--orange-50); border: 2px solid var(--navy-900); }
  [data-state=error] .is-error, [data-state=offline] .is-offline, [data-state=limit] .is-limit { display: flex; }
  .done { display: none; }
  [data-state=sent] .done { display: block; }
  [data-state=sent] form { display: none; }
  .done .tick { width: 48px; height: 48px; color: #0b6b3a; margin-bottom: 8px; }
  .btn .spin { display: none; width: 18px; height: 18px; border: 3px solid rgba(16,32,47,.3); border-top-color: var(--navy-900); border-radius: 50%; animation: spin .8s linear infinite; }
  [data-state=sending] .btn .spin { display: inline-block; }
  [data-state=sending] .btn { opacity: .85; pointer-events: none; }
  @keyframes spin { to { transform: rotate(360deg); } }
  @media (prefers-reduced-motion: reduce) { .btn .spin { animation-duration: 3s; } }
  .proto-bar { background: #fff8c5; color: #3b2f00; border-bottom: 1px solid #d4b200; padding: 8px var(--gutter); font-size: .875rem; }
  .proto-bar a { color: #3b2f00; margin-right: 10px; }
  /* Oculta la barra fija mientras se rellena el formulario (sin JavaScript) */
  body:has(#interes:focus-within) .sticky-cta { display: none; }

  .sticky-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

  @media (min-width: 600px) {
    .strip ul { grid-template-columns: repeat(2, 1fr); }
    .cards { grid-template-columns: repeat(2, 1fr); }
    .entries { grid-template-columns: 1fr 1fr; }
    .hero-cta { grid-template-columns: auto auto; max-width: none; justify-content: start; }
  }
  @media (min-width: 900px) {
    .logo { height: 38px; }
    .bar { padding-top: 14px; padding-bottom: 14px; }
    .only-mob { display: none !important; }
    .only-desk { display: inline-flex !important; }
    .nav { justify-content: center; }
    section[id] { scroll-margin-top: 136px; }

    .hero { padding: 88px 0 104px; }
    .hero .rails { right: -8vw; bottom: -10vw; width: 52vw; }
    .rails .inner { opacity: .9; }
    .hero-in { grid-template-columns: 1.25fr .75fr; align-items: end; gap: 48px; }
    .strip ul { grid-template-columns: repeat(4, 1fr); gap: 24px; }
    .section { padding: 88px 0; }
    .cards.four { grid-template-columns: repeat(4, 1fr); }
    .cards.three { grid-template-columns: repeat(3, 1fr); }
    .steps { grid-template-columns: repeat(4, 1fr); gap: 24px; }
    .steps li { padding: 60px 0 0; }
    .two { grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: start; }
    .foot { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
    .sticky-cta { display: none; }
    .split { grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }

  }

  /* Estados del formulario añadidos en #434: disabled = formulario aún no activado (falta el NIF, ver docs/tareas/434-portada-publica.md) */
  .off { display: none; }
  [data-state=disabled] .off { display: block; }
  [data-state=disabled] form, [data-state=disabled] .form-msg { display: none; }
  /* Páginas /interes/confirmar y /interes/baja */
  .accion { max-width: 560px; margin: 0 auto; padding: 48px var(--gutter) 72px; }
  .accion h1 { font-family: var(--font-display); font-size: clamp(1.75rem, 6vw, 2.25rem); line-height: 1.15; margin: 0 0 16px; color: var(--navy-900); }
  .accion p { font-size: 1.0625rem; line-height: 1.55; }
  .accion .resultado { display: none; }
  .accion[data-state=ok] .resultado-ok, .accion[data-state=invalid] .resultado-invalid, .accion[data-state=error] .resultado-error { display: block; }
  .accion[data-state=ready] .pedir, .accion[data-state=sending] .pedir, .accion[data-state=error] .pedir { display: block; }
  .accion .pedir { display: none; }
  .accion[data-state=sending] .btn { opacity: .85; pointer-events: none; }
  body.simple { background: #fff; color: var(--navy-900); font-family: var(--font-body); }
  body.simple a:not(.btn) { color: var(--orange-700); }
