/* =============================================================================
 * Notaría Segunda del Cantón Riobamba — Sistema de diseño
 * Estética "Elegancia notarial editorial": papel crema, serif de alto contraste,
 * monograma de pluma, sello de cera y reglas finas. Complementa a Tailwind.
 * ========================================================================== */

:root {
  --navy: #1d3587;
  --navy-dark: #16225a;
  --navy-light: #2c46a8;
  --accent: #e31837;
  --accent-dark: #b3122b;
  --cream: #f6f2e9;
  --paper: #fbf9f4;
  --ink: #2a2f45;
  --line: rgba(29, 53, 135, 0.16);
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  /* Grano de papel muy sutil: da calidez y evita el "flat" genérico */
  background-image:
    radial-gradient(circle at 15% 12%, rgba(29,53,135,0.025), transparent 40%),
    radial-gradient(circle at 85% 8%, rgba(227,24,55,0.02), transparent 35%);
}

/* Ligaduras y números elegantes en el serif de titulares */
.font-display { font-feature-settings: "liga" 1, "dlig" 1; letter-spacing: -0.01em; }

/* --------------------------------------------------------------------------- *
 * Eyebrow / antetítulo con línea
 * --------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 1.9rem;
  height: 1px;
  background: currentColor;
  display: inline-block;
}
.eyebrow.center::after {
  content: "";
  width: 1.9rem;
  height: 1px;
  background: currentColor;
  display: inline-block;
}

/* --------------------------------------------------------------------------- *
 * Regla fina con rombo central (motivo de documento)
 * --------------------------------------------------------------------------- */
.hairline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--line);
}
.hairline::before,
.hairline::after {
  content: "";
  height: 1px;
  flex: 1;
  background: currentColor;
}
.hairline > span {
  width: 6px; height: 6px;
  transform: rotate(45deg);
  background: var(--accent);
  flex: 0 0 auto;
}

/* --------------------------------------------------------------------------- *
 * Sello de cera (badge circular)
 * --------------------------------------------------------------------------- */
.seal {
  display: grid;
  place-items: center;
  border-radius: 9999px;
  background: radial-gradient(circle at 35% 30%, #f04a63, var(--accent) 45%, var(--accent-dark));
  color: #fff;
  text-align: center;
  box-shadow: 0 12px 28px -10px rgba(227, 24, 55, 0.6);
  position: relative;
}
.seal::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 9999px;
  border: 1px dashed rgba(255, 255, 255, 0.55);
}

/* --------------------------------------------------------------------------- *
 * Marco de fotografía (efecto lámina montada)
 * --------------------------------------------------------------------------- */
.frame {
  background: #fff;
  padding: 0.6rem;
  border-radius: 0.4rem;
  box-shadow: 0 30px 60px -25px rgba(22, 34, 90, 0.45);
  border: 1px solid rgba(22, 34, 90, 0.06);
}
.frame img { border-radius: 0.2rem; display: block; }

/* --------------------------------------------------------------------------- *
 * Tarjeta de servicio tipo "documento"
 * --------------------------------------------------------------------------- */
.doc-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}
.doc-card::after { /* filo dorado/rojo que aparece al hover, arriba */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.doc-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 26px 50px -30px rgba(22, 34, 90, 0.55);
  border-color: rgba(29, 53, 135, 0.3);
}
.doc-card:hover::after { transform: scaleX(1); }

.doc-card__index {
  position: absolute;
  top: 0.7rem; right: 1rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.6rem;
  font-weight: 600;
  line-height: 1;
  color: rgba(29, 53, 135, 0.10);
}
.doc-card__icon {
  width: 3.4rem; height: 3.4rem;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: #fff;
  padding: 0.6rem;
  margin-bottom: 1.1rem;
}
.doc-card__icon img,
.doc-card__icon svg { width: 100%; height: 100%; object-fit: contain; }

/* Icono en cabecera de página de servicio */
.sv-icon img,
.sv-icon svg { width: 100%; height: 100%; object-fit: contain; }

/* --------------------------------------------------------------------------- *
 * Filigrana del monograma (marca de agua)
 * --------------------------------------------------------------------------- */
.watermark {
  position: absolute;
  pointer-events: none;
  opacity: 0.05;
  filter: none;
}

/* --------------------------------------------------------------------------- *
 * Campos de formulario
 * --------------------------------------------------------------------------- */
.notaria-input {
  width: 100%;
  border: 1px solid #d9d2c4;
  border-radius: 0.35rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  color: var(--ink);
  background-color: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.notaria-input::placeholder { color: #b0a894; }
.notaria-input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(29, 53, 135, 0.13);
}
.notaria-input:user-invalid { border-color: var(--accent); }

/* --------------------------------------------------------------------------- *
 * FAQ (acordeón)
 * --------------------------------------------------------------------------- */
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-chevron { transition: transform 0.2s ease; }

/* --------------------------------------------------------------------------- *
 * Accesibilidad / utilidades
 * --------------------------------------------------------------------------- */
.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;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .reveal.is-visible { opacity: 1; transform: none; }
}

/* Enlace subrayado elegante */
.link-underline {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 0.3s ease;
}
.link-underline:hover { background-size: 100% 1.5px; }

/* =============================================================================
 * Recorrido inmersivo (video de instalaciones)
 * -----------------------------------------------------------------------------
 * Marco editorial con tinte azul institucional que se disipa al reproducir,
 * controles propios (play/pausa + sonido) y respeto por prefers-reduced-motion.
 * ========================================================================== */
.video-band {
  position: relative;
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--navy-dark);
  box-shadow: 0 40px 80px -35px rgba(22, 34, 90, 0.6);
}
.video-band video {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
/* Tinte azul (duotono sutil) que se aclara cuando el video está activo */
.video-band__tint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(22, 34, 90, 0.78) 0%, rgba(22, 34, 90, 0.10) 45%, rgba(22, 34, 90, 0.20) 100%);
  transition: opacity 0.6s ease;
}
.video-band.is-playing .video-band__tint { opacity: 0.55; }

.video-band__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  color: #fff;
  z-index: 2;
}

/* Botón de reproducción central (poster / reduced-motion) */
.video-band__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 5.5rem; height: 5.5rem;
  display: grid; place-items: center;
  border-radius: 9999px;
  background: rgba(227, 24, 55, 0.92);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 16px 34px -12px rgba(227, 24, 55, 0.7);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 3;
}
.video-band__play:hover { transform: scale(1.06); background: var(--accent); }
.video-band.is-playing .video-band__play { display: none; }

/* Controles pequeños (pausa / sonido) */
.vid-ctrl {
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.vid-ctrl:hover { background: rgba(255, 255, 255, 0.3); transform: translateY(-1px); }
.vid-ctrl:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* =============================================================================
 * Reseñas / Testimonios
 * ========================================================================== */
:root { --gold: #d8a02a; }

.testimonial {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 1.9rem 1.7rem 1.6rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.testimonial:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 46px -30px rgba(22, 34, 90, 0.5);
  border-color: rgba(29, 53, 135, 0.28);
}
.testimonial__quote-mark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 4.5rem;
  line-height: 0.7;
  color: rgba(29, 53, 135, 0.14);
  height: 1.6rem;
}
.stars { display: inline-flex; gap: 2px; color: var(--gold); }
.stars svg { width: 1.05rem; height: 1.05rem; }

.avatar-initials {
  width: 3rem; height: 3rem;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 9999px;
  background: var(--navy);
  color: #fff;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-verified {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.68rem; font-weight: 600;
  color: #1a7f4b;
}

/* =============================================================================
 * Franja "¿Por qué elegirnos?" — pilares de confianza
 * ========================================================================== */
.pillar {
  position: relative;
  padding: 1.6rem 1.4rem;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.pillar:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-3px);
}
.pillar__icon {
  width: 3rem; height: 3rem;
  display: grid; place-items: center;
  border-radius: 0.5rem;
  background: rgba(227, 24, 55, 0.16);
  color: #fff;
  margin-bottom: 1rem;
}
.pillar__icon svg { width: 1.6rem; height: 1.6rem; }

/* Sello institucional (respaldo) */
.trust-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
}
.trust-chip svg { width: 1.05rem; height: 1.05rem; color: #f0879a; }

/* En pantallas donde el usuario pide menos movimiento, ocultamos el tinte animado */
@media (prefers-reduced-motion: reduce) {
  .video-band__tint { transition: none; }
}

/* =============================================================================
 * Diploma del hero — formato certificado vertical, refinado
 * -----------------------------------------------------------------------------
 * Papel color hueso con degradado suave, marco fino con rombos en las esquinas,
 * y un bloque tipo escritura: título, motivo, sello grabado y firma.
 * ========================================================================== */
.diploma {
  position: relative;
  aspect-ratio: 5 / 6;
  width: 100%;
  max-width: 25rem;
  margin: 0 auto;
  padding: 1.1rem;
  background: radial-gradient(135% 100% at 50% -8%, #ffffff 0%, #fbf9f4 52%, #f2ecde 100%);
  border: 1px solid rgba(29, 53, 135, 0.14);
  border-radius: 0.7rem;
  box-shadow: 0 46px 90px -46px rgba(22, 34, 90, 0.42);
}
.diploma__frame {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.9rem;
  padding: 2.25rem 1.75rem;
  border: 1px solid rgba(29, 53, 135, 0.22);
  border-radius: 0.4rem;
}
/* Rombos decorativos en las esquinas del marco interior */
.diploma__corner {
  position: absolute;
  width: 7px; height: 7px;
  background: var(--navy);
  transform: rotate(45deg);
  opacity: 0.5;
}
.diploma__corner--tl { top: -4px; left: -4px; }
.diploma__corner--tr { top: -4px; right: -4px; }
.diploma__corner--bl { bottom: -4px; left: -4px; }
.diploma__corner--br { bottom: -4px; right: -4px; }

.diploma__eyebrow {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}
.diploma__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.35rem;
  font-weight: 700;
  line-height: 1;
  color: var(--navy-dark);
}
.diploma__subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--navy);
}
.diploma__motto {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.4;
  color: rgba(42, 47, 69, 0.7);
  max-width: 15rem;
}
/* Sello grabado, pequeño (junto a la firma) */
.diploma__seal {
  width: 64px; height: 64px;
  border-radius: 9999px;
  display: grid; place-items: center;
  position: relative;
  color: var(--navy-dark);
  background: radial-gradient(circle at 50% 38%, #ffffff, #f6f2e9);
  border: 1px solid rgba(29, 53, 135, 0.32);
  box-shadow: inset 0 0 0 4px #ffffff, inset 0 0 0 5px rgba(29, 53, 135, 0.12);
}
.diploma__seal::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 9999px;
  border: 1px dashed rgba(29, 53, 135, 0.28);
}
.diploma__seal span {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1;
}
.diploma__signature {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--navy-dark);
  line-height: 1;
}
.diploma__role {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(42, 47, 69, 0.55);
}

/* =============================================================================
 * Proceso "Su trámite en cuatro pasos" — resalte al pasar el mouse
 * -----------------------------------------------------------------------------
 * El paso enfocado sobresale: el número se ilumina (acento) y crece, el título
 * cambia a acento y todo el bloque se eleva; los demás pasos quedan en reposo.
 * ========================================================================== */
.proceso-step {
  transition: transform 0.25s ease;
  cursor: default;
}
.proceso-step .proceso-num {
  transition: color 0.25s ease, transform 0.25s ease;
  transform-origin: center bottom;
}
.proceso-step h3 { transition: color 0.25s ease; }
.proceso-step:hover { transform: translateY(-6px); }
.proceso-step:hover .proceso-num {
  color: var(--accent);
  transform: scale(1.14);
}
.proceso-step:hover h3 { color: var(--accent-dark); }
@media (prefers-reduced-motion: reduce) {
  .proceso-step, .proceso-step .proceso-num { transition: color 0.2s ease; }
  .proceso-step:hover { transform: none; }
  .proceso-step:hover .proceso-num { transform: none; }
}
