/* Desarrollo Pepe — estilos */

:root {
  /* Color (contrastes WCAG calculados en comentarios) */
  --color-bg: #f8f7f4;          /* fondo cálido */
  --color-surface: #ffffff;
  --color-bg-alt: #f0eee9;
  --color-text: #0f172a;        /* 17.1:1 sobre --color-bg */
  --color-muted: #475569;       /* 7.1:1 sobre --color-bg, 6.5:1 sobre --color-bg-alt */
  --color-border: #e3e0d8;
  --color-input-border: #64748b; /* 4.8:1 sobre blanco (no textual ≥3:1) */
  --color-accent: #4338ca;      /* índigo: 7.4:1 sobre --color-bg */
  --color-accent-hover: #3730a3;
  --color-accent-soft: #eceefe;
  --color-navy: #0b1f3a;        /* blanco sobre navy: 16.5:1 */
  --color-on-dark: #ffffff;
  --color-on-dark-muted: #cbd5e1; /* 11.1:1 sobre navy */
  --color-on-dark-link: #c7d2fe;  /* 11.1:1 sobre navy */
  --color-button: #15803d;      /* blanco: 5.0:1 */
  --color-button-hover: #166534; /* blanco: 7.1:1 */
  --color-on-accent: #ffffff;
  --color-error: #b42318;       /* 6.6:1 sobre blanco */
  --color-success: #146c3a;     /* 6.0:1 sobre --color-success-bg */
  --color-success-bg: #ecf8f0;

  /* Tipografía */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --step--1: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.15rem, 1.06rem + 0.4vw, 1.4rem);
  --step-2: clamp(1.9rem, 1.5rem + 1.8vw, 3rem);
  --step-3: clamp(2.6rem, 1.7rem + 4.2vw, 5.25rem);

  /* Espaciado */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: clamp(2rem, 1.5rem + 2vw, 3rem);
  --space-xl: clamp(4.5rem, 3rem + 6vw, 8.5rem);

  --radius-s: 0.625rem;
  --radius: 1rem;
  --radius-l: 1.5rem;
  --container: 74rem;
  --header-h: 4.5rem;

  --shadow-s: 0 1px 2px rgb(15 23 42 / 0.05), 0 2px 6px rgb(15 23 42 / 0.04);
  --shadow-m: 0 2px 4px rgb(15 23 42 / 0.04), 0 12px 32px -8px rgb(15 23 42 / 0.14);
  --shadow-l: 0 4px 8px rgb(15 23 42 / 0.04), 0 30px 60px -20px rgb(11 31 58 / 0.32);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --focus-ring: 3px solid var(--color-accent); /* 7.4:1 sobre fondo */
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (min-width: 40rem) {
  html { scroll-padding-top: var(--header-h); }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3 {
  margin: 0 0 var(--space-s);
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; }
h2 { font-size: var(--step-2); font-weight: 750; letter-spacing: -0.035em; }
h3 { font-size: var(--step-1); font-weight: 650; }

p {
  margin: 0 0 var(--space-s);
  text-wrap: pretty;
}

a {
  color: var(--color-accent);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

main:focus {
  outline: none;
}

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: var(--space-xs);
  left: var(--space-xs);
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 600;
  border-radius: 0.5rem;
  transform: translateY(-200%);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--color-on-accent);
  outline-color: var(--color-text);
}

/* ---------- Cabecera ---------- */
/* Fondo navy al 92 % sobre contenido claro: blanco sigue ≥13:1 en el peor caso */
.site-header {
  position: relative;
  z-index: 50;
  background: rgb(11 31 58 / 0.92);
  color: var(--color-on-dark);
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  box-shadow: 0 6px 24px -12px rgb(11 31 58 / 0.6);
}

/* Sticky solo cuando la cabecera cabe en una fila */
@media (min-width: 40rem) {
  .site-header {
    position: sticky;
    top: 0;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: var(--color-navy); }
}

/* Sobre azul marino el anillo índigo no contrasta: blanco (16.5:1) */
.site-header :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--color-on-dark);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-m);
  min-height: var(--header-h);
  padding-block: var(--space-xs);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  color: var(--color-on-dark);
  font-weight: 700;
  font-size: var(--step-1);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.logo:hover {
  color: var(--color-on-dark);
}

.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.6rem;
  background: linear-gradient(135deg, #4f46e5, #4338ca 60%, #312e81);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.25), 0 4px 12px -4px rgb(99 102 241 / 0.7);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.85rem;
  color: var(--color-on-dark);
  font-size: var(--step--1);
  font-weight: 550;
  text-decoration: none;
  border-radius: 999px;
  transition: background-color 0.2s var(--ease);
}

.nav-list a:hover {
  color: var(--color-on-dark);
  background: rgb(255 255 255 / 0.1);
}

.nav-list .nav-cta {
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.45);
}

.nav-list a:focus-visible {
  border-radius: 999px;
}

/* Con 4 enlaces, algo menos de relleno en móvil para que quepan */
@media (max-width: 30rem) {
  .nav-list a { padding-inline: 0.6rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.5rem, 2rem + 6vw, 7.5rem) var(--space-xl);
  background:
    radial-gradient(60rem 30rem at 85% 10%, rgb(99 102 241 / 0.14), transparent 60%),
    radial-gradient(40rem 24rem at 0% 100%, rgb(21 128 61 / 0.08), transparent 60%),
    var(--color-bg);
}

.hero::before {
  /* rejilla sutil */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(15 23 42 / 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgb(15 23 42 / 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  gap: clamp(3rem, 2rem + 4vw, 5rem);
  align-items: center;
}

@media (min-width: 60rem) {
  .hero-grid {
    grid-template-columns: 1.05fr 1fr;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: var(--space-s);
  color: var(--color-accent);
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.hero h1 {
  max-width: 12ch;
  margin-bottom: var(--space-m);
}

.lead {
  max-width: 36ch;
  margin-bottom: var(--space-l);
  color: var(--color-muted);
  font-size: var(--step-1);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-s) var(--space-m);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  color: var(--color-text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgb(15 23 42 / 0.3);
  text-underline-offset: 0.3em;
}

.link-arrow::after {
  content: "→";
  content: "→" / "";
  transition: transform 0.25s var(--ease);
}

.link-arrow:hover {
  color: var(--color-accent);
  text-decoration-color: currentColor;
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

/* Botón */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.8rem 1.75rem;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--color-button);
  color: var(--color-on-accent);
  font: inherit;
  font-weight: 650;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(20 83 45 / 0.2), 0 8px 20px -8px rgb(21 128 61 / 0.6);
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.button:hover {
  background: var(--color-button-hover);
  color: var(--color-on-accent);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgb(20 83 45 / 0.2), 0 14px 28px -10px rgb(21 128 61 / 0.7);
}

.button:active {
  transform: translateY(0);
}

/* Anillo de foco verde oscuro: 7.1:1 sobre blanco */
.button:focus-visible {
  border-radius: 999px;
  outline-color: var(--color-button-hover);
}

/* Imagen del hero: hueco con proporción fija (4:3) */
.hero-media {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
}

/* Cuando exista la imagen real */
.hero-media picture,
.hero-media > img {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-l);
}

/* Maqueta decorativa */
.mock-browser {
  position: absolute;
  inset: 0 6% 8% 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-l);
  background: #ffffff;
  box-shadow: var(--shadow-l), 0 0 0 1px rgb(15 23 42 / 0.06);
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid #eceae4;
  background: #f7f6f2;
}

.mock-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #d9d6ce;
}

.mock-dot:first-child { background: #f87171; }
.mock-dot:nth-child(2) { background: #fbbf24; }
.mock-dot:nth-child(3) { background: #4ade80; }

.mock-url {
  flex: 1;
  max-width: 55%;
  height: 0.9rem;
  margin-left: 0.75rem;
  border-radius: 999px;
  background: #eceae4;
}

.mock-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6%;
  padding: 5% 6%;
  background:
    radial-gradient(120% 80% at 100% 0%, rgb(99 102 241 / 0.16), transparent 55%),
    linear-gradient(180deg, #ffffff, #f8f7f4);
}

.mock-nav {
  display: flex;
  gap: 0.5rem;
}

.mock-nav span {
  width: 12%;
  height: 0.45rem;
  border-radius: 999px;
  background: #e3e0d8;
}

.mock-nav span:first-child {
  width: 18%;
  margin-right: auto;
  background: #0b1f3a;
}

.mock-hero {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.mock-line {
  display: block;
  height: 0.6rem;
  border-radius: 999px;
  background: #e3e0d8;
}

.mock-line-lg { width: 70%; height: 1.3rem; background: #0f172a; border-radius: 0.4rem; }
.mock-line-md { width: 85%; }
.mock-line-sm { width: 55%; }

.mock-pill {
  display: block;
  width: 28%;
  height: 1.3rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: #15803d;
}

.mock-cards {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4%;
}

.mock-cards span {
  border-radius: 0.6rem;
  background: #ffffff;
  box-shadow: 0 0 0 1px #eceae4, 0 6px 14px -8px rgb(15 23 42 / 0.2);
  background-image: linear-gradient(#eceefe, #eceefe);
  background-size: 30% 22%;
  background-position: 18% 22%;
  background-repeat: no-repeat;
}

.mock-phone {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 30%;
  aspect-ratio: 9 / 18;
  padding: 1.1rem 0.7rem 0.8rem;
  border: 5px solid #0b1f3a;
  border-radius: 1.5rem;
  background: #ffffff;
  box-shadow: var(--shadow-l);
  animation: float 7s ease-in-out infinite;
}

.mock-notch {
  position: absolute;
  top: 0.35rem;
  left: 50%;
  width: 30%;
  height: 0.35rem;
  border-radius: 999px;
  background: #0b1f3a;
  transform: translateX(-50%);
}

.mock-phone-img {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 0.6rem;
  background: linear-gradient(135deg, #6366f1, #312e81);
}

.mock-phone .mock-line { height: 0.45rem; }
.mock-phone .mock-pill { width: 60%; height: 1rem; margin-top: auto; }

.mock-badge {
  position: absolute;
  left: -4%;
  bottom: 14%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-m), 0 0 0 1px rgb(15 23 42 / 0.05);
  animation: float 8s ease-in-out -3s infinite;
}

.mock-badge-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background:
    linear-gradient(135deg, transparent 45%, #ffffff 45%, #ffffff 55%, transparent 55%) center / 60% 60% no-repeat,
    #15803d;
}

.mock-badge-lines {
  display: grid;
  gap: 0.35rem;
}

.mock-badge-lines span {
  display: block;
  width: 5rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #0f172a;
}

.mock-badge-lines span + span {
  width: 3.5rem;
  background: #e3e0d8;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (max-width: 30rem) {
  .mock-badge { display: none; }
  .mock-phone { border-width: 4px; border-radius: 1.1rem; padding: 0.8rem 0.45rem 0.5rem; gap: 0.35rem; }
}

/* ---------- Secciones ---------- */
.section {
  padding-block: var(--space-xl);
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-head {
  max-width: 44rem;
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
}

.section-intro {
  max-width: 50ch;
  margin-bottom: 0;
  color: var(--color-muted);
  font-size: var(--step-1);
  line-height: 1.55;
}

/* Tarjetas de servicios */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-m);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48rem) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

.card {
  position: relative;
  overflow: hidden;
  padding: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem) clamp(1.5rem, 1.2rem + 1vw, 2rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-l);
  background: var(--color-surface);
  box-shadow: var(--shadow-s);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

.card::before {
  /* barra de acento superior */
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent), #6366f1 60%, var(--color-button));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}

.card:hover {
  transform: translateY(-6px);
  border-color: #c9c5f3;
  box-shadow: var(--shadow-m);
}

.card:hover::before {
  transform: scaleX(1);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-l);
}

.card-icon {
  display: block;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0.75rem;
  border-radius: 0.9rem;
  background: var(--color-accent-soft);
  color: var(--color-accent); /* 6.9:1 sobre el fondo suave */
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

.card:hover .card-icon {
  background: var(--color-accent);
  color: #ffffff;
}

.card-num {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-style: italic;
  line-height: 1;
  color: #8a8578; /* decorativo (aria-hidden); 3.7:1 */
}

.card h3 {
  margin-bottom: 0.6rem;
}

.card p {
  margin: 0;
  color: var(--color-muted);
}

/* Precios (importes de ejemplo de un estudio ficticio) */
.section-pricing {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}

.plans {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-m);
  align-items: stretch;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 60rem) {
  .plans { grid-template-columns: repeat(3, 1fr); }
}

.plans > li {
  display: flex;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem) clamp(1.5rem, 1.2rem + 1vw, 2rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-l);
  background: var(--color-surface);
  box-shadow: var(--shadow-s);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

.plan:hover {
  transform: translateY(-6px);
  border-color: #c9c5f3;
  box-shadow: var(--shadow-m);
}

.plan-name {
  margin-bottom: 0.4rem;
  font-size: var(--step-1);
}

.plan-desc {
  margin-bottom: var(--space-m);
  color: var(--color-muted);
}

.plan-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.5rem;
  margin-bottom: var(--space-m);
  padding-bottom: var(--space-m);
  border-bottom: 1px solid var(--color-border);
}

.plan-from,
.plan-period {
  color: var(--color-muted);
  font-size: var(--step--1);
}

.plan-amount {
  font-size: clamp(2rem, 1.7rem + 1.2vw, 2.6rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.plan-features {
  display: grid;
  gap: 0.7rem;
  margin: 0 0 var(--space-l);
  padding: 0;
  list-style: none;
}

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  line-height: 1.45;
}

.plan-features svg {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.05rem;
  padding: 0.1rem;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent); /* 6.9:1 sobre el fondo suave */
}

.plan .button {
  width: 100%;
  margin-top: auto;
}

/* Botón secundario: verde sobre blanco 5.0:1; al pasar el ratón se rellena */
.button-outline {
  border-color: var(--color-button);
  background: transparent;
  color: var(--color-button);
  box-shadow: none;
}

.button-outline:hover {
  border-color: var(--color-button);
  background: var(--color-button);
  color: var(--color-on-accent);
}

/* Plan destacado: azul marino como la cabecera */
.plan-featured {
  border-color: var(--color-navy);
  background:
    radial-gradient(30rem 16rem at 100% 0%, rgb(99 102 241 / 0.28), transparent 65%),
    var(--color-navy);
  color: var(--color-on-dark);            /* 16.5:1 */
  box-shadow: var(--shadow-l);
}

.plan-featured:hover {
  border-color: var(--color-navy);
  box-shadow: var(--shadow-l);
}

.plan-featured .plan-desc,
.plan-featured .plan-from,
.plan-featured .plan-period {
  color: var(--color-on-dark-muted);      /* 11.1:1 */
}

.plan-featured .plan-price {
  border-bottom-color: rgb(255 255 255 / 0.18);
}

.plan-featured .plan-features svg {
  background: rgb(134 239 172 / 0.16);
  color: #86efac;                          /* 11.8:1 sobre navy */
}

/* Botón verde sobre navy: borde del botón 3.3:1; anillo de foco blanco 16.5:1 */
.plan-featured :focus-visible {
  outline-color: var(--color-on-dark);
}

.plan-badge {
  align-self: flex-start;
  margin-bottom: var(--space-s);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: #c7d2fe;
  color: var(--color-navy);               /* 11.1:1 */
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Testimonios */
.section-testimonials {
  background:
    radial-gradient(50rem 24rem at 100% 0%, rgb(99 102 241 / 0.07), transparent 60%),
    var(--color-bg);
  border-top: 1px solid var(--color-border);
}

.testimonials {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-m);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48rem) {
  .testimonials { grid-template-columns: repeat(2, 1fr); }
}

.testimonial {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  height: 100%;
  margin: 0;
  padding: clamp(1.75rem, 1.4rem + 1.5vw, 2.75rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-l);
  background: var(--color-surface);
  box-shadow: var(--shadow-s);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.testimonial:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-m);
}

.testimonial-quote {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--color-accent);
  opacity: 0.9;
}

.testimonial blockquote {
  flex: 1;
  margin: 0;
}

.testimonial blockquote p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 1.08rem + 0.5vw, 1.5rem);
  line-height: 1.5;
  letter-spacing: -0.005em;
}

.testimonial figcaption {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  padding-top: var(--space-m);
  border-top: 1px solid var(--color-border);
}

.testimonial-avatar {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #3730a3);
  color: #ffffff; /* ≥6.3:1 en todo el degradado */
  font-weight: 700;
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  box-shadow: 0 0 0 3px var(--color-surface), 0 0 0 4px #c9c5f3;
}

.testimonial-avatar-alt {
  background: linear-gradient(135deg, #15803d, #14532d);
  box-shadow: 0 0 0 3px var(--color-surface), 0 0 0 4px #b7dfc4;
}

.testimonial-name {
  display: block;
  line-height: 1.3;
}

.testimonial-role {
  display: block;
  color: var(--color-muted);
  font-size: var(--step--1);
}

/* ---------- Contacto ---------- */
.contact-grid {
  display: grid;
  gap: var(--space-l);
  align-items: start;
}

@media (min-width: 56rem) {
  .contact-grid {
    grid-template-columns: 1fr 1.15fr;
    gap: clamp(3rem, 2rem + 4vw, 6rem);
  }

  .contact-copy {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
  }
}

.contact-card {
  padding: clamp(1.5rem, 1.1rem + 2vw, 2.75rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-l);
  background: var(--color-surface);
  box-shadow: var(--shadow-m);
}

.contact-form {
  display: grid;
  gap: var(--space-m);
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.95rem;
  border: 1.5px solid var(--color-input-border);
  border-radius: var(--radius-s);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.field input:hover,
.field textarea:hover {
  border-color: var(--color-text);
}

.field textarea {
  resize: vertical;
  min-height: 9rem;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--color-accent);
  border-radius: var(--radius-s);
  box-shadow: 0 0 0 6px rgb(67 56 202 / 0.12);
}

.field [aria-invalid="true"] {
  border-color: var(--color-error);
  border-width: 2px;
}

.field-hint {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--step--1);
}

.field-error {
  margin: 0;
  color: var(--color-error);
  font-size: var(--step--1);
  font-weight: 600;
}

.field-error::before {
  content: "⚠ ";
}

.contact-form .button {
  justify-self: start;
  margin-top: var(--space-xs);
}

@media (max-width: 30rem) {
  .contact-form .button { justify-self: stretch; }
}

.form-status:empty {
  display: none;
}

.form-status {
  margin-bottom: var(--space-m);
  padding: var(--space-s) var(--space-m);
  border: 1px solid currentColor;
  border-left-width: 4px;
  border-radius: var(--radius-s);
  background: var(--color-success-bg);
  color: var(--color-success);
  font-weight: 600;
}

.form-status.is-error {
  background: #fdf0ef;
  color: var(--color-error); /* 5.9:1 sobre #fdf0ef */
}

/* ---------- Pie ---------- */
.site-footer {
  padding-block: var(--space-l);
  background: var(--color-navy);
  color: var(--color-on-dark-muted);
  font-size: var(--step--1);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--color-on-dark-link);
}

.site-footer a:hover {
  color: var(--color-on-dark);
}

/* ---------- Aparición al hacer scroll (solo si JS añade .js-reveal) ---------- */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}

.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js-reveal .reveal {
    opacity: 1;
    transform: none;
  }

  .button:hover,
  .card:hover,
  .plan:hover,
  .testimonial:hover {
    transform: none;
  }
}

/* ---------- Alto contraste forzado ---------- */
@media (forced-colors: active) {
  .button,
  .card-icon,
  .logo-mark,
  .card,
  .plan,
  .plan-badge,
  .testimonial,
  .contact-card {
    border: 1px solid CanvasText;
  }
}
