/*
 * certificados.css — Estilos de la plantilla Certificados e informes.
 *
 * Depende de main.css. Prefijo: ce-
 *
 * Paleta de acento: verde esmeralda/teal (documentación técnica).
 * Diferenciado de GMAO-GSAT (naranja), A3ERP (azul).
 *
 * Estructura:
 *   1. Hero
 *   2. Intro (3 bloques)
 *   3. Certificados BOE (grid checklist)
 *   4. Informes operativos (grid tarjetas)
 *   5. Otros certificados (split)
 *   6. CTA
 *   7. Animaciones
 *   8. Responsive
 */

/* ─── Variables propias ──────────────────────────────────────────────── */
:root {
  --ce-green:      #0f5132;
  --ce-green-2:    #083a24;
  --ce-teal:       #0d9488;
  --ce-teal-pale:  rgba(13,148,136,.12);
  --ce-teal-glow:  rgba(13,148,136,.28);
}

/* ─── 1. Hero ──────────────────────────────────────────────────────────── */

.ce-hero {
  position: relative;
  overflow: hidden;
  padding: 7rem 0 5.5rem;
  background: linear-gradient(155deg, var(--ce-green) 0%, #0b2e1c 55%, var(--ce-green-2) 100%);
  color: var(--color-dark-on);
}

.ce-hero__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 55% at 6% 30%,  rgba(13,148,136,.35)  0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 94% 70%,  rgba(216,131,41,.18)  0%, transparent 50%),
    radial-gradient(ellipse 100% 45% at 50% 115%, rgba(8,58,36,.8)     0%, transparent 60%);
  pointer-events: none;
}

.ce-hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3.5rem;
  align-items: center;
}

.ce-hero__copy .eyebrow { margin-bottom: .75rem; }

.ce-hero__copy h1 {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-size: clamp(2.8rem, 6.5vw, 6.5rem);
  line-height: .9;
  letter-spacing: -.04em;
  margin: 0 0 1.5rem;
  background: linear-gradient(135deg, #6ee7b7 0%, #34d399 45%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ce-hero__lead {
  font-size: 1.1rem;
  color: rgba(244,247,251,.75);
  max-width: 54ch;
  margin: 0 0 2.5rem;
  line-height: 1.67;
}

.ce-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Stats */
.ce-hero__stats {
  display: grid;
  gap: .85rem;
  min-width: 210px;
}

.ce-hero__stat {
  display: flex;
  flex-direction: column;
  gap: .22rem;
  padding: 1.2rem 1.5rem;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09);
  transition: background .25s, transform .25s;
}

.ce-hero__stat:hover {
  background: rgba(255,255,255,.1);
  transform: translateX(-4px);
}

.ce-hero__stat--accent {
  background: linear-gradient(135deg, rgba(13,148,136,.28), rgba(13,148,136,.12));
  border-color: rgba(13,148,136,.4);
}

.ce-hero__stat-val {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  color: #6ee7b7;
}
.ce-hero__stat--accent .ce-hero__stat-val { color: #34d399; }

.ce-hero__stat-lab {
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(244,247,251,.48);
}

.ce-btn--light {
  background: rgba(255,255,255,.1);
  color: var(--color-dark-on);
  border: 1px solid rgba(255,255,255,.2);
}
.ce-btn--light:hover,
.ce-btn--light:focus-visible {
  background: rgba(255,255,255,.18);
  color: var(--color-dark-on);
}

/* ─── 2. Intro ────────────────────────────────────────────────────────── */

.ce-intro {
  background: var(--color-surface);
}

.ce-intro__inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.ce-intro__block {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--ce-teal);
  transition: transform .3s, box-shadow .3s;
}

.ce-intro__block:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.ce-intro__icon {
  width: 2.2rem;
  height: 2.2rem;
  color: var(--ce-teal);
}
.ce-intro__icon svg { width: 100%; height: 100%; }

.ce-intro__block h3 {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-size: 1.2rem;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--color-secondary);
}

.ce-intro__block p {
  font-size: .92rem;
  line-height: 1.6;
  color: var(--color-muted);
  margin: 0;
}

/* ─── 3. Certificados BOE ─────────────────────────────────────────────── */

.ce-certs {
  background: var(--color-light);
}

.ce-certs .section-heading { text-align: center; max-width: 60ch; margin: 0 auto 3rem; }

.ce-cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}

.ce-cert-item {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: .92rem;
  line-height: 1.45;
  color: var(--color-secondary);
  font-weight: 500;
  transition: background .2s, transform .2s, border-color .2s;
}

.ce-cert-item:hover {
  background: var(--ce-teal-pale);
  border-color: rgba(13,148,136,.3);
  transform: translateX(3px);
}

.ce-cert-item__icon {
  width: 1.2rem;
  height: 1.2rem;
  color: var(--ce-teal);
  flex-shrink: 0;
  margin-top: .1rem;
}
.ce-cert-item__icon svg { width: 100%; height: 100%; }

/* ─── 4. Informes ────────────────────────────────────────────────────── */

.ce-reports {
  background: var(--color-surface-soft);
}

.ce-reports .section-heading { text-align: center; max-width: 60ch; margin: 0 auto 3rem; }

.ce-reports__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.3rem;
}

.ce-rep-card {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 3px 14px rgba(16,32,47,.05);
  position: relative;
  overflow: hidden;
  transition: transform .3s, box-shadow .3s;
}

.ce-rep-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ce-teal), #6ee7b7);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s ease;
}

.ce-rep-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.ce-rep-card:hover::before { transform: scaleX(1); }

.ce-rep-card__icon {
  width: 2.2rem;
  height: 2.2rem;
  color: var(--ce-teal);
  background: var(--ce-teal-pale);
  border-radius: var(--radius-sm);
  padding: .4rem;
  box-sizing: border-box;
}
.ce-rep-card__icon svg { width: 100%; height: 100%; }

.ce-rep-card h3 {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-size: 1.1rem;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--color-secondary);
}

.ce-rep-card p {
  font-size: .88rem;
  line-height: 1.55;
  color: var(--color-muted);
  margin: 0;
}

/* ─── 5. Otros certificados ───────────────────────────────────────────── */

.ce-others {
  background: linear-gradient(160deg, var(--ce-green) 0%, var(--ce-green-2) 100%);
  color: var(--color-dark-on);
}

.ce-others__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.ce-others__copy .eyebrow { margin-bottom: .75rem; }

.ce-others__copy h2 {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  line-height: .98;
  letter-spacing: -.025em;
  margin: 0 0 1.25rem;
  color: var(--color-dark-on);
}

.ce-others__copy > p {
  font-size: 1.02rem;
  line-height: 1.7;
  color: rgba(244,247,251,.72);
  margin: 0 0 2rem;
  max-width: 50ch;
}

.ce-others__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
}

.ce-others__list li {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  font-size: .94rem;
  color: rgba(244,247,251,.8);
  line-height: 1.5;
}

.ce-others__list-dot {
  flex-shrink: 0;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #34d399;
  margin-top: .46rem;
}

/* ─── 6. CTA ──────────────────────────────────────────────────────────── */

.ce-cta {
  position: relative;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(150deg, var(--color-dark) 0%, #0c2518 100%);
  color: var(--color-dark-on);
}

.ce-cta__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 60% at 50% 50%, rgba(13,148,136,.2) 0%, transparent 60%);
  pointer-events: none;
}

.ce-cta__inner {
  position: relative;
  max-width: 64ch;
  margin: 0 auto;
}

.ce-cta__inner .eyebrow { margin-bottom: .75rem; }

.ce-cta__inner h2 {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-size: clamp(2rem, 3.6vw, 3.4rem);
  line-height: .98;
  letter-spacing: -.025em;
  margin: 0 0 1.25rem;
  color: var(--color-dark-on);
}

.ce-cta__inner > p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(244,247,251,.7);
  margin: 0 0 2rem;
}

.ce-cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* ─── 7. Animaciones ─────────────────────────────────────────────────── */

/* Stagger hero stats */
.ce-hero__stats .ce-hero__stat {
  animation: revealUp .5s cubic-bezier(.22,.68,0,1.2) both;
}
.ce-hero__stats .ce-hero__stat:nth-child(1) { animation-delay: .28s; }
.ce-hero__stats .ce-hero__stat:nth-child(2) { animation-delay: .38s; }
.ce-hero__stats .ce-hero__stat:nth-child(3) { animation-delay: .46s; }
.ce-hero__stats .ce-hero__stat:nth-child(4) { animation-delay: .54s; }

/* H1 degradado animado */
@keyframes gradientShiftGreen {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.ce-hero__copy h1 {
  background-size: 200% 200%;
  animation: gradientShiftGreen 4s ease infinite;
}

/* Stagger cert items */
.ce-cert-grid.is-visible .ce-cert-item {
  animation: revealUp .3s ease both;
}
.ce-cert-grid.is-visible .ce-cert-item:nth-child(1)  { animation-delay: .03s; }
.ce-cert-grid.is-visible .ce-cert-item:nth-child(2)  { animation-delay: .06s; }
.ce-cert-grid.is-visible .ce-cert-item:nth-child(3)  { animation-delay: .09s; }
.ce-cert-grid.is-visible .ce-cert-item:nth-child(4)  { animation-delay: .12s; }
.ce-cert-grid.is-visible .ce-cert-item:nth-child(5)  { animation-delay: .15s; }
.ce-cert-grid.is-visible .ce-cert-item:nth-child(6)  { animation-delay: .18s; }
.ce-cert-grid.is-visible .ce-cert-item:nth-child(7)  { animation-delay: .21s; }
.ce-cert-grid.is-visible .ce-cert-item:nth-child(8)  { animation-delay: .24s; }
.ce-cert-grid.is-visible .ce-cert-item:nth-child(9)  { animation-delay: .27s; }
.ce-cert-grid.is-visible .ce-cert-item:nth-child(10) { animation-delay: .30s; }
.ce-cert-grid.is-visible .ce-cert-item:nth-child(11) { animation-delay: .33s; }
.ce-cert-grid.is-visible .ce-cert-item:nth-child(12) { animation-delay: .36s; }
.ce-cert-grid.is-visible .ce-cert-item:nth-child(13) { animation-delay: .39s; }
.ce-cert-grid.is-visible .ce-cert-item:nth-child(14) { animation-delay: .42s; }
.ce-cert-grid.is-visible .ce-cert-item:nth-child(15) { animation-delay: .45s; }

/* Stagger others list */
.ce-others__list.is-visible li {
  animation: revealUp .35s ease both;
}
.ce-others__list.is-visible li:nth-child(1) { animation-delay: .05s; }
.ce-others__list.is-visible li:nth-child(2) { animation-delay: .10s; }
.ce-others__list.is-visible li:nth-child(3) { animation-delay: .15s; }
.ce-others__list.is-visible li:nth-child(4) { animation-delay: .20s; }
.ce-others__list.is-visible li:nth-child(5) { animation-delay: .25s; }
.ce-others__list.is-visible li:nth-child(6) { animation-delay: .30s; }

/* ─── 8. Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  .ce-cert-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ce-reports__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  .ce-hero { padding: 5rem 0 3.5rem; }

  .ce-hero__inner,
  .ce-others__inner {
    grid-template-columns: 1fr;
  }

  .ce-hero__stats {
    grid-template-columns: repeat(2, 1fr);
    min-width: unset;
  }

  .ce-intro__inner {
    grid-template-columns: 1fr;
  }

  .ce-reports__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .ce-hero__stats { grid-template-columns: 1fr; }

  .ce-cert-grid {
    grid-template-columns: 1fr;
  }
}
