/* =========================================================
   Variables — personaliza aquí colores, tipografía y marca
   ========================================================= */
:root {
  --color-primary: #1a1a1a;
  --color-primary-dark: #000000;
  --color-accent: #d4af37;
  --color-bg: #f4f5f7;
  --color-card-bg: #e9eaed;
  --color-text: #1a1a1a;
  --color-text-muted: #666666;
  --color-border: #cfd3da;
  --color-white: #ffffff;
  --color-input-bg: #ffffff;
  --color-danger: #c0392b;
  --color-success: #1e8449;
  --font-family: 'Inter', 'Segoe UI', Arial, Helvetica, sans-serif;
  --radius: 10px;
  --max-width: 640px;
}

/* =========================================================
   Variante de fondo negro — se activa agregando data-theme="dark"
   al <html> (ver el botón "Modo oscuro" y app.js).
   ========================================================= */
:root[data-theme='dark'] {
  color-scheme: dark;
  --color-bg: #0a0a0a;
  --color-card-bg: #1c1c1e;
  --color-text: #ffffff;
  --color-text-muted: #b0b0b0;
  --color-border: #3a3a3a;
  --color-input-bg: #2c2c2e;
  --color-danger: #ff6b6b;
  --color-success: #4cd97b;
}

body {
  transition: background-color 0.2s ease, color 0.2s ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

a {
  color: var(--color-text);
}

.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;
}

/* =========================================================
   Header / Banner
   ========================================================= */
.hero {
  position: relative;
  background: var(--color-primary);
  line-height: 0;
}

.hero__image {
  display: block;
  width: 100%;
  height: auto;
}

/* =========================================================
   Formulario
   ========================================================= */
.form-section {
  max-width: var(--max-width);
  margin: -34px auto 40px;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

.form-card {
  background: var(--color-card-bg);
  border-radius: var(--radius);
  padding: 28px 24px 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.form-card__title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--color-text);
  margin: 4px 0 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-input-bg);
  /* 16px (no 14px) a propósito: por debajo de 16px, Safari en iOS hace
     zoom automático al enfocar el campo. */
  font-size: 16px;
  font-family: inherit;
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.15);
}

.form-control[disabled] {
  background: #f1f1f1;
  cursor: not-allowed;
}

:root[data-theme='dark'] .form-control[disabled] {
  background: #2a2a2c;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%23666666' stroke-width='1.6' fill='none' fill-rule='evenodd'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
}

:root[data-theme='dark'] select.form-control {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%23b0b0b0' stroke-width='1.6' fill='none' fill-rule='evenodd'/></svg>");
}

.field-error {
  color: var(--color-danger);
  font-size: 12px;
  margin-top: 4px;
  min-height: 14px;
}

.form-control.is-invalid {
  border-color: var(--color-danger);
}

.checkbox-row,
.radio-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.checkbox-row input,
.radio-row input {
  margin-top: 3px;
  flex-shrink: 0;
}

.checkbox-row label,
.radio-row label {
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.consent-text {
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin: 4px 0 12px;
}

.radio-group {
  margin-bottom: 18px;
}

.submit-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 30px;
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.submit-btn:hover:not(:disabled) {
  background: var(--color-primary-dark);
}

.submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* En oscuro invertimos el botón (blanco sobre la tarjeta oscura): un botón
   negro casi no se distinguiría de la tarjeta ni del fondo. */
:root[data-theme='dark'] .submit-btn {
  background: #ffffff;
  color: #0a0a0a;
}

:root[data-theme='dark'] .submit-btn:hover:not(:disabled) {
  background: #d9d9d9;
}

.form-alert {
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
  display: none;
}

.form-alert.is-visible {
  display: block;
}

.form-alert--success {
  background: #e6f4ea;
  color: var(--color-success);
  border: 1px solid #b7e0c4;
}

.form-alert--warning {
  background: #fdf3e1;
  color: #8a5a00;
  border: 1px solid #f1d79a;
}

.form-alert--error {
  background: #fbe9e7;
  color: var(--color-danger);
  border: 1px solid #f3c1ba;
}

:root[data-theme='dark'] .form-alert--success {
  background: rgba(76, 217, 123, 0.12);
  border-color: rgba(76, 217, 123, 0.35);
}

:root[data-theme='dark'] .form-alert--warning {
  background: rgba(255, 193, 90, 0.12);
  color: #ffc15a;
  border-color: rgba(255, 193, 90, 0.35);
}

:root[data-theme='dark'] .form-alert--error {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.35);
}

/* =========================================================
   Modal de confirmación
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 27, 51, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: modal-fade-in 0.2s ease;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--color-input-bg);
  border-radius: var(--radius);
  padding: 36px 28px 28px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: modal-pop-in 0.25s ease;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: var(--color-text);
}

.modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #e6f4ea;
  color: var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
}

:root[data-theme='dark'] .modal-icon {
  background: rgba(76, 217, 123, 0.15);
}

.modal-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--color-text);
  margin: 0 0 10px;
}

.modal-desc {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0 0 22px;
  line-height: 1.5;
}

.modal-ok-btn {
  max-width: 200px;
  margin: 0 auto;
  border-radius: 30px;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-pop-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* =========================================================
   Botón "Modo oscuro" — oculto por ahora (a pedido del cliente).
   Para reactivarlo: quitar el "display: none !important" de abajo y
   destapar el script de /index.html que aplica el tema guardado.
   ========================================================= */
.theme-toggle {
  display: none !important;
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 60;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.theme-toggle:hover {
  background: rgba(0, 0, 0, 0.75);
}

@media (max-width: 480px) {
  .theme-toggle {
    top: 10px;
    right: 10px;
    padding: 7px 12px;
    font-size: 11.5px;
  }
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  text-align: center;
  padding: 20px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 480px) {
  .form-section {
    margin-top: 0;
    padding: 0;
  }

  .form-card {
    border-radius: 0;
    padding: 22px 18px 26px;
  }

  .form-card__title {
    font-size: 17px;
  }
}
