/* ==========================================================================
   SEL Latam — Reset y estilos base
   ========================================================================== */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body-size);
  line-height: var(--line-height-body);
  color: var(--text-body-color);
  background: var(--color-white);
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--line-height-heading);
  margin: 0 0 var(--space-4);
  color: var(--color-primary-dark);
}

h1 { font-size: var(--text-h1-mobile); }
h2 { font-size: var(--text-h2-mobile); }
h3 { font-size: var(--text-h3-mobile); }
h4 { font-size: var(--text-h4-mobile); }

@media (min-width: 1024px) {
  h1 { font-size: var(--text-h1-desktop); }
  h2 { font-size: var(--text-h2-desktop); }
  h3 { font-size: var(--text-h3-desktop); }
  h4 { font-size: var(--text-h4-desktop); }
  body { font-size: var(--text-body-size-desktop); }
}

p { margin: 0 0 var(--space-4); max-width: 70ch; }

a { color: var(--color-accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }

/* ---- Skip link (accesibilidad) ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary-dark);
  color: var(--color-white);
  padding: var(--space-3) var(--space-5);
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
}

/* ---- Foco visible global ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-accent-blue);
  outline-offset: 2px;
}

/* ---- Utilidades de layout ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.section {
  padding: var(--space-7) 0;
}

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

.section-title {
  text-align: center;
  margin-bottom: var(--space-5);
}

.section-title p {
  max-width: 60ch;
  margin: 0 auto;
  text-align: center;
  color: var(--text-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---- Botones ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 12px 28px;
  font-size: var(--text-button);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--color-accent-blue);
  color: var(--color-white);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--color-primary-dark);
  color: var(--color-white);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn-block { width: 100%; }

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: var(--color-white);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.is-loading .btn-spinner { display: inline-block; }
.is-loading .btn-label { display: none; }

/* ---- Header / footer de la página de formulario ---- */
.page-header {
  background: var(--color-header-bg);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4) 0;
}

.page-header__inner {
  display: flex;
  justify-content: center;
}

.page-header__logo {
  height: 50px;
  width: auto;
}

/* Banner de encabezado (reemplaza al logo) */
.page-header--banner {
  padding: 0;
  border-bottom: none;
  background: #000;
  line-height: 0;
}

.page-header__banner {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center top;
  display: block;
}

@media (min-width: 640px) {
  .page-header__banner { height: 260px; }
}

@media (min-width: 1024px) {
  .page-header__banner { height: 300px; }
}

.page-footer {
  background: var(--color-primary-dark);
  color: var(--color-white);
  padding: var(--space-5) 0;
  text-align: center;
  font-size: var(--text-small);
}

.page-footer a {
  color: var(--color-white);
  font-weight: 600;
}

.page-footer p {
  margin: 0 0 var(--space-2);
  max-width: none;
}

.page-footer__copy {
  color: rgba(255,255,255,0.7);
  margin-bottom: 0 !important;
}
