/* ==========================================================================
   CUENCA COLÁN E.I.R.L. — International Architectural Editorial System
   Zero-Card Principle: No floating boxes, no drop-shadow tiles, no card grids.
   Structure is defined purely by typography, negative space, 1px hairlines,
   and full-bleed surface shifts.
   ========================================================================== */

:root {
  --font-display: 'Roboto', system-ui, -apple-system, sans-serif;
  --font-serif: 'Roboto', system-ui, -apple-system, sans-serif;
  --font-sans: 'Roboto', system-ui, -apple-system, sans-serif;
  --font-mono: 'Roboto', system-ui, -apple-system, sans-serif;
  --font-form: 'Roboto', system-ui, -apple-system, sans-serif;

  /* Regla 60-30-10 Cuenca Colán: 60% Blanco · 30% Verde Abeto · 10% Rojo Tomate */
  --bg-page: #ffffff;
  --bg-alt: #f4f7f5;
  --bg-white: #ffffff;
  --bg-fir: #164232;
  --bg-mint: #164232;
  --bg-dark: #103226;
  --bg-dark-elevated: #1c4f3c;
  --fir: #164232;
  --ink: #103226;
  --ink-muted: #3a5449;
  --ink-subtle: #597267;
  --accent: #c93322;
  --accent-hover: #a62618;
  --accent-light: #ff9583;
  --hairline: rgba(22, 66, 50, 0.14);
  --hairline-strong: rgba(22, 66, 50, 0.28);
  --hairline-dark: rgba(255, 255, 255, 0.20);
  --hairline-dark-strong: rgba(255, 255, 255, 0.38);
  --selection-bg: #f5cfc8;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  background-color: var(--bg-white);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  transition: background-color 0.45s ease, color 0.35s ease;
}

::selection {
  background: var(--selection-bg);
  color: var(--ink);
}

/* Typography utilities — Roboto Universal System */
.font-display {
  font-family: var(--font-display);
}
.font-editorial {
  font-family: var(--font-sans);
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.015em;
}
.font-mono-code {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Language Switcher (ES | EN) */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-left: 1rem;
  border-left: 1px solid var(--hairline-strong);
}
.lang-btn {
  background: transparent;
  border: 0;
  padding: 0.25rem 0.2rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.lang-btn:hover {
  opacity: 0.85;
}
.lang-btn[aria-pressed='true'] {
  opacity: 1;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Surface helpers (60% Blanco · 30% Verde Abeto · 10% Rojo Tomate) */
.surface-page {
  background-color: var(--bg-page);
  color: var(--ink);
}
.surface-alt {
  background-color: var(--bg-alt);
  color: var(--ink);
}
.surface-fir {
  background-color: var(--bg-fir);
  color: #ffffff;
}
.surface-mint {
  background-color: var(--bg-fir);
  color: #ffffff;
}
.surface-dark {
  background-color: var(--bg-dark);
  color: #ffffff;
}
.surface-emerald {
  background-color: var(--bg-fir);
  color: #ffffff;
}

/* Tinte Verde Abeto para el SVG blanco de Aceros Arequipa si se usa sobre crema */
.logo-teal-filter {
  filter: brightness(0) saturate(100%) invert(18%) sepia(34%) saturate(956%) hue-rotate(115deg) brightness(91%) contrast(93%);
}

/* Hairlines */
.rule-t {
  border-top: 1px solid var(--hairline);
}
.rule-b {
  border-bottom: 1px solid var(--hairline);
}
.rule-l {
  border-left: 1px solid var(--hairline);
}
.rule-y {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.rule-y-strong {
  border-top: 1px solid var(--hairline-strong);
  border-bottom: 1px solid var(--hairline-strong);
}
.rule-dark-t {
  border-top: 1px solid var(--hairline-dark);
}
.rule-dark-b {
  border-bottom: 1px solid var(--hairline-dark);
}
.rule-dark-l {
  border-left: 1px solid var(--hairline-dark);
}

.text-ink {
  color: var(--ink);
}
.text-fir {
  color: var(--fir);
}
.text-muted {
  color: var(--ink-muted);
}
.text-subtle {
  color: var(--ink-subtle);
}
.text-accent {
  color: var(--accent);
}
.text-accent-light {
  color: var(--accent-light);
}

/* ==========================================================================
   HEADER — Blanco Puro Luminoso + Filete Verde Abeto + Logo Protagonista
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  color: var(--ink);
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 3px solid var(--fir);
  border-bottom: 1px solid var(--hairline);
}

.site-header.is-scrolled {
  background-color: rgba(255, 255, 255, 0.99);
  border-bottom-color: var(--hairline-strong);
}

/* Anillo arquitectónico Verde Abeto + halo sutil Rojo Tomate para el logo */
.brand-logo-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  overflow: hidden;
  background-color: #ffffff;
  border: 2.5px solid var(--fir);
  outline: 1px solid rgba(201, 51, 34, 0.42);
  outline-offset: 2.5px;
  transition: transform 0.3s ease, outline-color 0.25s ease, border-color 0.25s ease;
}

.group:hover .brand-logo-ring,
.brand-logo-ring:hover {
  outline-color: var(--accent);
}

.portal-tab {
  position: relative;
  padding: 0.5rem 0.2rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  opacity: 0.55;
  transition: opacity 0.25s ease, color 0.25s ease;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--ink);
}

.portal-tab:hover {
  opacity: 0.92;
}

.portal-tab[aria-selected='true'] {
  opacity: 1;
  color: var(--accent);
}

.portal-tab[aria-selected='true']::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background-color: var(--accent);
}

/* ==========================================================================
   FULL-BLEED DAYLIGHT CINEMATIC VIDEO HERO (BLANCO PURO VEIL)
   ========================================================================== */
.hero-stage {
  position: relative;
  min-height: 84svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #ffffff;
  color: var(--ink);
  overflow: hidden;
}

.hero-video-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transform: scale(1.03);
  will-change: opacity, transform;
}

.hero-video-layer.is-active {
  opacity: 1;
}
.hero-video-layer.is-inactive {
  opacity: 0;
  pointer-events: none;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(102deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.91) 46%, rgba(255, 255, 255, 0.56) 76%, rgba(255, 255, 255, 0.24) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.80) 0%, rgba(255, 255, 255, 0.14) 34%, rgba(255, 255, 255, 0.88) 100%);
}

/* Subtle daylight architectural texture */
.hero-grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0.022;
  pointer-events: none;
  background-image: radial-gradient(rgba(22, 66, 50, 0.7) 0.5px, transparent 0.5px);
  background-size: 5px 5px;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(2.45rem, 5.6vw, 5.2rem);
  line-height: 0.99;
  letter-spacing: -0.032em;
  font-weight: 700;
}

/* ==========================================================================
   BUTTONS & LINKS — Sharp Architectural Precision (No Pill Bloat)
   ========================================================================== */
.btn-editorial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.95rem 1.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background-color: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-editorial:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-editorial-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.95rem 1.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background-color: #ffffff;
  color: var(--ink);
  border: 1px solid #ffffff;
  transition: background-color 0.25s ease, color 0.25s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-editorial-light:hover {
  background-color: var(--bg-page);
}

.btn-ghost-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.95rem 1.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background-color: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.36);
  transition: border-color 0.25s ease, background-color 0.25s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-ghost-light:hover {
  border-color: #ffffff;
  background-color: rgba(255, 255, 255, 0.10);
}

.btn-ghost-ink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 1.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background-color: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
  transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-ghost-ink:hover {
  border-color: var(--ink);
  background-color: var(--ink);
  color: #ffffff;
}

.link-underline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: inherit;
  text-decoration: none;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid currentColor;
  transition: opacity 0.2s ease, gap 0.2s ease;
  cursor: pointer;
  background: transparent;
  border-top: 0;
  border-left: 0;
  border-right: 0;
}

.link-underline:hover {
  opacity: 0.75;
  gap: 0.75rem;
}

/* ==========================================================================
   INTERACTIVE INDEX ROWS (Replaces Cards Completely)
   ========================================================================== */
.index-row {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.35rem 0.25rem;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.25s ease, padding-left 0.25s ease, border-color 0.25s ease;
}

.index-row:hover {
  color: var(--ink);
  padding-left: 0.65rem;
}

.index-row[aria-selected='true'] {
  color: var(--ink);
  padding-left: 0.85rem;
  border-bottom-color: var(--accent);
}

.index-row[aria-selected='true']::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.1rem;
  bottom: 1.1rem;
  width: 2px;
  background-color: var(--accent);
}

/* Light-mode intake interactive rows (Step 1 — Zero Cards, High Legibility) */
.intake-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.55rem 0.35rem;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  cursor: pointer;
  transition: padding-left 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.intake-row:hover {
  padding-left: 0.9rem;
  border-bottom-color: var(--accent);
  background-color: rgba(201, 51, 34, 0.04);
}

.intake-row .row-arrow {
  transition: transform 0.25s ease, color 0.25s ease;
}

.intake-row:hover .row-arrow {
  transform: translateX(6px);
  color: var(--accent);
}

/* Minimalist Architectural Underline Inputs — Crisp Light Surface */
.editorial-input {
  width: 100%;
  padding: 0.9rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--hairline-strong);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-sans);
  outline: none;
  border-radius: 0;
  transition: border-color 0.25s ease, background-color 0.2s ease;
}

.editorial-input::placeholder {
  color: #82958b;
  font-size: 0.92rem;
  font-weight: 400;
}

.editorial-input:focus {
  border-bottom-color: var(--accent);
}

/* Tipografía Roboto unificada en toda la web y formularios */
body,
button,
input,
select,
textarea {
  font-family: var(--font-sans);
}

.formal-form label {
  letter-spacing: 0.04em;
  font-weight: 500;
  font-size: 0.78rem;
}

.formal-form .editorial-input {
  font-size: 0.96rem;
  font-weight: 400;
}

.formal-form .editorial-input::placeholder {
  font-family: var(--font-form);
  font-size: 0.9rem;
}

select.editorial-input {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 1.75rem;
}

.surface-white {
  background-color: var(--bg-white);
  color: var(--ink);
}

.surface-white .live-dot,
.surface-white .live-dot::after,
.surface-alt .live-dot,
.surface-alt .live-dot::after {
  background-color: var(--accent);
}

.editorial-input-light {
  width: 100%;
  padding: 0.65rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline-strong);
  color: var(--ink);
  font-size: 0.875rem;
  outline: none;
  border-radius: 0;
  transition: border-color 0.25s ease;
}

.editorial-input-light:focus {
  border-bottom-color: var(--accent);
}

/* ==========================================================================
   ARCHITECTURAL ESG RANGE SLIDER (VERDE ABETO + BLANCO + ROJO TOMATE)
   ========================================================================== */
input[type='range'].editorial-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.28);
  outline: none;
  cursor: pointer;
}

input[type='range'].editorial-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: #d83d2c;
  border: 2px solid #ffffff;
  border-radius: 0;
  transform: rotate(45deg);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

input[type='range'].editorial-slider::-webkit-slider-thumb:hover {
  transform: rotate(45deg) scale(1.18);
  background: #eb4e3c;
}

input[type='range'].editorial-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #d83d2c;
  border: 2px solid #ffffff;
  border-radius: 0;
  transform: rotate(45deg);
  cursor: pointer;
}

/* ==========================================================================
   PULSE TELEMETRY DOT & MOTION
   ========================================================================== */
@keyframes livePulse {
  0% { transform: scale(0.95); opacity: 0.75; }
  70% { transform: scale(2.1); opacity: 0; }
  100% { transform: scale(2.1); opacity: 0; }
}

.live-dot {
  position: relative;
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background-color: var(--accent);
}

.live-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background-color: var(--accent);
  animation: livePulse 2.4s infinite;
}

.step-fade {
  animation: stepFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .live-dot::after,
  .seal-orbit,
  .seal-stamp-in {
    animation: none;
  }
}

/* ==========================================================================
   OFFICIAL SEAL KINETIC MOTION & STAMP WATERMARK (SELLOS-COLAN.png)
   ========================================================================== */
@keyframes sealOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.seal-orbit {
  animation: sealOrbit 42s linear infinite;
  transition: opacity 0.3s ease;
  will-change: transform;
}

.seal-orbit:hover {
  animation-play-state: paused;
}

@keyframes stampPress {
  0% {
    opacity: 0;
    transform: scale(1.45) rotate(-18deg);
  }
  70% {
    opacity: 0.95;
    transform: scale(0.96) rotate(-9deg);
  }
  100% {
    opacity: 0.9;
    transform: scale(1) rotate(-10deg);
  }
}

.seal-stamp-in {
  transform: rotate(-10deg);
  opacity: 0.9;
  animation: stampPress 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ==========================================================================
   PRINT MODE — Clean Official A4 Certificate Export (Zero Chrome)
   ========================================================================== */
@media print {
  header,
  #hero-stage,
  #portal-empresas,
  #portal-gobierno,
  #solicitud,
  footer,
  .no-print {
    display: none !important;
  }

  body,
  #certificado-modelo {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}
