/*
 * Copyright (c) 2026 XOUBIT SRL. All rights reserved.
 *
 * This file is part of XERP and is licensed under the proprietary
 * license of XOUBIT SRL. See the LICENSE.md file for terms and conditions.
 *
 * Unauthorized copying, modification, distribution or use is strictly prohibited.
 *
 * SPDX-License-Identifier: LicenseRef-Proprietary
 */

/* Landing público de Fidelitica.
   Paleta del manual de identidad (FIDELITICA/): azul #003764, gris #898A8D y texto #231F20
   sobre blanco — los mismos valores que frontend/src/index.css. El verde solo se usa para el
   estado "Aceptado" del e-CF. Tipografía: Source Sans 3, la familia abierta más cercana al
   logotipo (una humanista tipo Myriad). */
:root {
  color-scheme: light;
  --navy: #003764;
  --navy-deep: #00294b;
  --navy-soft: #adc2d4;
  --ink: #231f20;
  --muted: #5d6063;
  --rule: #d8d9db;
  --tint: #f1f5f8;
  --paper: #ffffff;
  --ok: #1a7f37;
  --ok-bg: #e6f4ea;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: var(--navy);
}

:focus-visible {
  outline: 3px solid #4f8fce;
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.nowrap {
  white-space: nowrap;
}

.narrow {
  max-width: 760px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--navy);
  color: #fff;
  border-radius: 6px;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Botones y enlaces ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 26px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.15s ease;
}

.btn-small {
  min-height: 42px;
  padding: 8px 18px;
  font-size: 1rem;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}

.btn-primary:hover {
  background: var(--navy-deep);
}

.btn-light {
  background: #fff;
  color: var(--navy);
}

.btn-light:hover {
  background: var(--tint);
}

.link-quiet {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--navy-soft);
  text-underline-offset: 4px;
}

.link-quiet:hover {
  text-decoration-color: var(--navy);
}

/* ---------- Encabezado ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.brand img {
  width: 137px;
}

.site-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

.site-nav a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: 12px;
}

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

.hero {
  padding-block: clamp(48px, 8vw, 104px) clamp(56px, 8vw, 112px);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.25rem, 5.2vw, 3.75rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--navy);
  text-wrap: balance;
}

.lead {
  margin-top: 24px;
  max-width: 34em;
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 36px;
}

.fine {
  margin-top: 18px;
  color: var(--muted);
  font-size: 1rem;
}

/* ---------- El e-CF de ejemplo (pieza central del hero) ---------- */

.ecf {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 460px;
  font-variant-numeric: tabular-nums;
}

/* El rombo del logotipo, detrás de la hoja. */
.ecf::before {
  content: '';
  position: absolute;
  inset: 6% -4% 14% 8%;
  background: var(--navy);
  border-right: 18px solid #898a8d;
  transform: rotate(-11deg);
  z-index: 0;
}

.ecf-sheet {
  position: relative;
  z-index: 1;
  padding: 26px 26px 22px;
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: 0 24px 48px -18px rgba(0, 41, 75, 0.45);
  font-size: 0.875rem;
  line-height: 1.4;
}

.ecf-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--navy);
}

.ecf-company {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy);
}

.ecf-meta {
  color: var(--muted);
  font-size: 0.8125rem;
}

.ecf-meta strong {
  color: var(--ink);
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
}

.ecf-type {
  max-width: 11.5em;
  text-align: right;
  font-size: 0.8125rem;
  font-weight: 600;
}

.ecf-ncf {
  margin-top: 4px;
  font-weight: 700;
  color: var(--navy);
}

.ecf-lines {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
}

.ecf-lines th {
  padding: 0 0 6px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
}

.ecf-lines td {
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.ecf-lines .num {
  padding-left: 10px;
  text-align: right;
  white-space: nowrap;
}

.ecf-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-top: 18px;
}

.ecf-seal {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.ecf-qr {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  fill: var(--ink);
  shape-rendering: crispEdges;
}

.ecf-totals {
  min-width: 11em;
}

.ecf-totals div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0;
}

.ecf-totals dt {
  color: var(--muted);
}

.ecf-totals .ecf-total {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 2px solid var(--navy);
  font-size: 1.0625rem;
  font-weight: 700;
}

.ecf-totals .ecf-total dt {
  color: var(--ink);
}

/* Recorrido del comprobante: es una secuencia real, por eso va como lista ordenada. */
.ecf-track {
  position: relative;
  z-index: 1;
  display: flex;
  margin-top: 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: 0 12px 28px -16px rgba(0, 41, 75, 0.4);
  font-size: 0.875rem;
  font-weight: 600;
}

.ecf-track li {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 6px;
  color: #9a9c9f;
  text-align: center;
  line-height: 1.2;
  transition: color 0.3s ease, background-color 0.3s ease;
}

.ecf-track li + li {
  border-left: 1px solid var(--rule);
}

.ecf-track li::before {
  content: '';
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  transition: background-color 0.3s ease;
}

.ecf-track li.is-done {
  color: var(--navy);
}

.ecf-track li.is-done::before {
  background: currentColor;
}

.ecf-track li.is-done.is-final {
  color: var(--ok);
  background: var(--ok-bg);
}

.ecf figcaption {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: right;
}

/* ---------- Secciones ---------- */

.section {
  padding-block: clamp(56px, 8vw, 104px);
}

.band {
  padding-block: clamp(56px, 8vw, 104px);
  background: var(--tint);
}

h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--navy);
  text-wrap: balance;
}

h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.25;
}

.section-head {
  max-width: 38em;
  margin-bottom: clamp(32px, 4vw, 52px);
}

.section-head p {
  margin-top: 14px;
  font-size: 1.1875rem;
  color: var(--muted);
}

/* ---------- DGII ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(28px, 6vw, 88px);
  align-items: start;
}

.split-head {
  position: sticky;
  top: 112px;
}

.split-head p {
  margin-top: 16px;
  font-size: 1.1875rem;
  color: var(--muted);
}

.facts div {
  display: grid;
  grid-template-columns: minmax(0, 0.55fr) minmax(0, 1fr);
  gap: 8px 28px;
  padding-block: 22px;
  border-top: 1px solid #c3ced8;
}

.facts div:last-child {
  border-bottom: 1px solid #c3ced8;
}

.facts dt {
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--navy);
}

/* ---------- Módulos ---------- */

.modules {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 28px;
  border-top: 3px solid var(--navy);
}

.module {
  padding-top: 20px;
}

.module h3 {
  color: var(--navy);
}

.module ul {
  margin-top: 12px;
}

.module li {
  padding-block: 7px;
  border-top: 1px solid var(--rule);
  line-height: 1.35;
}

.addons {
  margin-top: clamp(40px, 5vw, 64px);
  padding: clamp(24px, 4vw, 40px);
  border-left: 18px solid #898a8d;
  background: var(--tint);
}

.addons ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 40px;
  margin-top: 18px;
}

.addons li strong {
  color: var(--navy);
}

.addons > p {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #c3ced8;
  font-weight: 600;
}

/* ---------- Cómo funciona ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  counter-reset: paso;
}

.steps li {
  counter-increment: paso;
  padding-top: 18px;
  border-top: 3px solid var(--navy);
}

.steps li::before {
  content: counter(paso);
  display: block;
  margin-bottom: 10px;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--navy);
}

.steps p {
  margin-top: 8px;
  color: var(--muted);
}

/* ---------- Preguntas ---------- */

.faq details {
  border-top: 1px solid var(--rule);
}

.faq details:last-child {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 20px;
  font-size: 1.1875rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  flex-shrink: 0;
  font-size: 1.625rem;
  font-weight: 400;
  line-height: 1;
  color: var(--navy);
}

.faq details[open] summary::after {
  content: '−';
}

.faq details p {
  max-width: 38em;
  padding-bottom: 22px;
  color: var(--muted);
}

/* ---------- Cierre y pie ---------- */

.cta {
  padding-block: clamp(48px, 7vw, 88px);
  background: var(--navy);
  color: #fff;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px 48px;
}

.cta h2 {
  max-width: 17em;
  color: #fff;
}

.cta p {
  margin-top: 12px;
  font-size: 1.1875rem;
  color: var(--navy-soft);
}

.site-footer {
  padding-block: 28px;
  background: var(--navy-deep);
  color: var(--navy-soft);
  font-size: 0.9375rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
}

/* ---------- Pantallas medianas y pequeñas ---------- */

@media (max-width: 980px) {
  .site-nav {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  .modules {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 0;
  }

  .module {
    margin-top: 28px;
    border-top: 3px solid var(--navy);
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .hero-grid,
  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .split-head {
    position: static;
  }

  .ecf {
    margin-top: 16px;
  }
}

@media (max-width: 600px) {
  .header-row {
    gap: 12px;
    min-height: 64px;
  }

  .brand img {
    width: 114px;
  }

  .header-actions {
    gap: 14px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .facts div {
    grid-template-columns: minmax(0, 1fr);
  }

  .modules,
  .addons ul,
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .addons {
    border-left-width: 10px;
  }

  .ecf::before {
    inset: 8% 2% 16% 6%;
    border-right-width: 12px;
  }

  .ecf-sheet {
    padding: 18px 16px 16px;
    font-size: 0.8125rem;
  }

  .ecf-qr {
    width: 60px;
    height: 60px;
  }

  .ecf-track {
    font-size: 0.75rem;
  }

  .cta .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .ecf-track li,
  .ecf-track li::before {
    transition: none;
  }
}
