/* =============================================
   PAPILLON — Perfilación de Salones
   CSS principal · styles.css
   Fresca · Moderna · Minimalista · Funcional
   ============================================= */

/* ── 1. TOKENS ──────────────────────────────── */
:root {
  /* Paleta */
  --ink:        #111110;
  --ink-soft:   #4a4845;
  --ink-muted:  #8a8680;
  --paper:      #fafaf8;
  --surface:    #ffffff;
  --border:     #e8e6e1;
  --border-focus: #111110;

  /* Acento dorado — identidad Papillon */
  --gold:       #c9a84c;
  --gold-light: #f0e4c0;
  --gold-dark:  #a0823a;

  /* Estados */
  --error:      #c0392b;
  --error-bg:   #fdf0ef;
  --success:    #2c6e49;
  --success-bg: #edf7f1;

  /* Tipografía — Montserrat únicamente */
  --font-display: 'Montserrat', sans-serif;
  --font-body:    'Montserrat', sans-serif;

  /* Espaciado */
  --space-xs:  0.375rem;
  --space-sm:  0.75rem;
  --space-md:  1.25rem;
  --space-lg:  2rem;
  --space-xl:  3rem;
  --space-2xl: 5rem;

  /* Forma */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* Transición */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur:  200ms;
}

/* ── 2. RESET & BASE ────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

/* ── 3. HEADER ──────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 0.85rem var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

/* Logo PNG en el header */
.brand-logo {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
}

.doc-label {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* ── 4. HERO ────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: var(--space-2xl) var(--space-lg) var(--space-xl);
  /* Fallback mientras carga el video */
  background: var(--ink);
}

/* Video de fondo */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}

/* Overlay negro 70% de opacidad */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.70);
  z-index: 1;
}

.hero-inner {
  max-width: 780px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-sm);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  margin-bottom: var(--space-md);
}

.hero-title em {
  font-style: normal;
  color: var(--gold);
}

.hero-sub {
  font-size: 0.95rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  max-width: 480px;
  line-height: 1.75;
}

/* ── 5. FORM SHELL ──────────────────────────── */
.form-shell {
  flex: 1;
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg) var(--space-2xl);
}

/* ── 6. FIELDSET / SECTION ──────────────────── */
fieldset {
  border: none;
  padding: 0;
}

.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  margin-bottom: var(--space-lg);
}

.section-legend {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.legend-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: var(--radius-full);
  background: var(--ink);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0;
  flex-shrink: 0;
}

/* ── 7. FIELD GROUP ─────────────────────────── */
.field-group {
  margin-bottom: var(--space-lg);
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-row {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.field-grow { flex: 1; }

.field-zona { width: 120px; flex-shrink: 0; }

/* ── 8. LABELS ──────────────────────────────── */
.field-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--space-sm);
  line-height: 1.4;
}

.req-mark {
  color: var(--gold-dark);
  margin-left: 2px;
}

/* ── 9. TEXT / TEL INPUTS ───────────────────── */
.field-input {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.field-input::placeholder {
  color: var(--ink-muted);
  font-weight: 400;
}

.field-input:hover {
  border-color: var(--ink-soft);
}

.field-input:focus {
  border-color: var(--border-focus);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(17, 17, 16, 0.08);
}

/* Textarea */
.field-textarea {
  height: auto;
  padding: var(--space-md);
  resize: vertical;
  line-height: 1.6;
}

/* Estado de error en input */
.field-input.is-invalid {
  border-color: var(--error);
  background: var(--error-bg);
}

.field-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

/* ── 10. RADIO CHIPS ────────────────────────── */
.radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--space-sm);
}

.radio-grid--3 {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.radio-grid--2 {
  grid-template-columns: repeat(2, minmax(90px, 160px));
}

.radio-chip {
  position: relative;
  display: flex;
  cursor: pointer;
}

/* Ocultar input nativo pero mantener accesibilidad */
.radio-chip input[type="radio"],
.check-chip input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.radio-chip span,
.check-chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  line-height: 1.3;
  transition: border-color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              color var(--dur) var(--ease),
              transform 100ms var(--ease);
  user-select: none;
}

.radio-chip:hover span,
.check-chip:hover span {
  border-color: var(--ink-soft);
  color: var(--ink);
}

/* Checked state */
.radio-chip input[type="radio"]:checked + span,
.check-chip input[type="checkbox"]:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 500;
}

/* Variantes Sí/No */
.radio-chip--yes input[type="radio"]:checked + span {
  background: var(--success);
  border-color: var(--success);
}

.radio-chip--no input[type="radio"]:checked + span {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}

/* Focus visible (accesibilidad teclado) */
.radio-chip input[type="radio"]:focus-visible + span,
.check-chip input[type="checkbox"]:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Chip en estado error (radio groups sin seleccionar) */
.radio-chip.is-invalid span,
.check-chip.is-invalid span {
  border-color: var(--error);
  background: var(--error-bg);
}

/* ── 11. CHECKBOXES ─────────────────────────── */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-sm);
}

.check-chip {
  position: relative;
  display: flex;
  cursor: pointer;
}

/* ── 12. ERROR MESSAGES ─────────────────────── */
.field-error {
  display: block;
  font-size: 0.78rem;
  color: var(--error);
  margin-top: var(--space-xs);
  min-height: 1em;
  font-weight: 400;
}

/* ── 13. HONEYPOT (trampa bots) ─────────────── */
.bot-trap {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
  tab-index: -1;
  aria-hidden: true;
}

/* ── 14. SUBMIT ZONE ────────────────────────── */
.submit-zone {
  margin-top: var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
}

.btn-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  height: 52px;
  padding: 0 var(--space-xl);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--ink);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--dur) var(--ease),
              transform 100ms var(--ease),
              box-shadow var(--dur) var(--ease);
  min-width: 220px;
}

.btn-submit:hover {
  background: #2a2a28;
  box-shadow: 0 4px 20px rgba(17, 17, 16, 0.22);
  transform: translateY(-1px);
}

.btn-submit:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-submit:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Spinner de carga */
.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-submit.is-loading .btn-label { opacity: 0.5; }
.btn-submit.is-loading .btn-spinner { display: block; }

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

.submit-note {
  font-size: 0.75rem;
  color: var(--ink-muted);
  max-width: 420px;
  line-height: 1.5;
}

/* ── 15. SUCCESS CARD ───────────────────────── */
.success-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  animation: fadeUp 400ms var(--ease) both;
}

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

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  font-size: 1.8rem;
  margin-bottom: var(--space-lg);
}

.success-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--space-sm);
}

.success-body {
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 380px;
  margin: 0 auto var(--space-lg);
  line-height: 1.7;
}

.btn-reset {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink);
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}

.btn-reset:hover {
  border-color: var(--ink);
  background: var(--paper);
}

/* ── 16. ERROR BANNER ───────────────────────── */
.error-banner {
  background: var(--error-bg);
  border: 1px solid rgba(192, 57, 43, 0.25);
  border-radius: var(--radius-md);
  color: var(--error);
  padding: var(--space-md) var(--space-lg);
  font-size: 0.88rem;
  margin-top: var(--space-md);
  line-height: 1.5;
}

/* ── 17. FOOTER ─────────────────────────────── */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem;
  text-align: center;
  padding: var(--space-lg);
  letter-spacing: 0.04em;
}

/* ── 18. RESPONSIVE ─────────────────────────── */
@media (max-width: 600px) {

  .header-inner {
    padding: 0.75rem var(--space-md);
  }

  .hero {
    padding: var(--space-xl) var(--space-md) var(--space-lg);
  }

  .form-shell {
    padding: var(--space-lg) var(--space-md) var(--space-xl);
  }

  .form-section {
    padding: var(--space-lg) var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
  }

  .field-row {
    flex-direction: column;
    gap: var(--space-md);
  }

  .field-zona {
    width: 100%;
  }

  .radio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .radio-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .radio-grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .check-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn-submit {
    width: 100%;
  }

  .submit-zone {
    align-items: stretch;
  }
}

@media (max-width: 360px) {
  .radio-grid,
  .radio-grid--3,
  .check-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 19. REDUCCIÓN DE MOVIMIENTO ────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
