/*
  Expo y Foro México-China de Comercio e Inversión — 14° Edición 2026
  style.css — Versión clara
  ─────────────────────────────────────────────────────────────
  Paleta principal:
    Rojo institucional : #be1e2d
    Fondo              : #f5f5f5
    Superficie         : #ffffff
    Superficie 2       : #f9f9f9
    Borde              : #e4e4e4
    Texto principal    : #1a1a1a
    Texto secundario   : #666666
*/

/* ─── 0. Reset + base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:        #be1e2d;
  --red-dark:   #8c1520;
  --red-glow:   rgba(190,30,45,0.08);
  --bg:         #f0f0f0;
  --surface:    #ffffff;
  --surface-2:  #f9f9f9;
  --border:     #e4e4e4;
  --border-red: rgba(190,30,45,0.25);
  --text:       #1a1a1a;
  --text-muted: #777777;
  --font:       'Outfit', sans-serif;
  --radius:     10px;
  --radius-lg:  14px;
  --transition: 0.18s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── 1. Layout contenedor ────────────────────────────────── */
.page-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

/* ─── 2. Header / Banner ──────────────────────────────────── */
.site-header {
  background: linear-gradient(160deg, #7a0e1a 0%, #be1e2d 50%, #7a0e1a 100%);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.03) 0px,
    rgba(255,255,255,0.03) 1px,
    transparent 1px,
    transparent 20px
  );
  pointer-events: none;
}

.header-logo {
  max-width: 100%;
  max-height: 220px;
  width: auto;
  display: block;
  margin: 0 auto;
  position: relative;
}

/* ─── 3. Formulario externo ───────────────────────────────── */
.form-outer { width: 100%; }

.registro-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ─── 4. Secciones del formulario ─────────────────────────── */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  margin-bottom: 16px;
  animation: fadeUp 0.4s ease both;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

.form-section:nth-child(1) { animation-delay: 0.05s; }
.form-section:nth-child(2) { animation-delay: 0.10s; }
.form-section:nth-child(3) { animation-delay: 0.15s; }
.form-section:nth-child(4) { animation-delay: 0.20s; }
.form-section:nth-child(5) { animation-delay: 0.25s; }
.form-section:nth-child(6) { animation-delay: 0.30s; }
.form-section:nth-child(7) { animation-delay: 0.35s; }

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 22px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-red);
}

.section-num {
  background: var(--red-glow);
  color: var(--red);
  border: 1px solid var(--border-red);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

/* ─── 5. Grupos de campos ─────────────────────────────────── */
.field-group { margin-bottom: 18px; }
.field-group:last-child { margin-bottom: 0; }

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.req { color: var(--red); margin-left: 2px; }

/* ─── 6. Inputs y selects ─────────────────────────────────── */
.form-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.form-input:hover {
  border-color: #c0c0c0;
}

.form-input:focus {
  border-color: var(--red);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(190,30,45,0.10);
}

.form-input::placeholder { color: #bbbbbb; }

select.form-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

select.form-input option {
  background: #ffffff;
  color: #1a1a1a;
}

/* ─── 7. Grids de columnas ────────────────────────────────── */
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* ─── 8. Tarjetas de tipo de visitante ────────────────────── */
.tipo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.tipo-card { cursor: pointer; }

.tipo-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0; height: 0;
}

.tipo-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 20px 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  transition: all var(--transition);
  user-select: none;
}

.tipo-card:hover .tipo-card-inner {
  border-color: rgba(190,30,45,0.4);
  background: rgba(190,30,45,0.04);
}

.tipo-card input:checked + .tipo-card-inner {
  border-color: var(--red);
  background: var(--red-glow);
  box-shadow: 0 0 0 3px rgba(190,30,45,0.08);
}

.tipo-icon {
  width: 32px;
  height: 32px;
  color: #aaaaaa;
  transition: color var(--transition);
}

.tipo-card input:checked + .tipo-card-inner .tipo-icon {
  color: var(--red);
}

.tipo-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.tipo-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ─── 9. Pills de sector de interés ───────────────────────── */
.sector-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sector-pill {
  cursor: pointer;
  position: relative;
}

.sector-pill input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0; height: 0;
}

.sector-pill span {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 400;
  color: #555555;
  background: var(--surface-2);
  transition: all var(--transition);
  user-select: none;
}

.sector-pill:hover span {
  border-color: rgba(190,30,45,0.4);
  color: var(--red);
  background: rgba(190,30,45,0.04);
}

.sector-pill input:checked + span {
  border-color: var(--red);
  background: rgba(190,30,45,0.08);
  color: var(--red);
  font-weight: 600;
}

/* ─── 10. Toggle switches ─────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color var(--transition);
}

.toggle-row:hover { border-color: #c0c0c0; }

.toggle-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 78%;
}

.toggle-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.toggle-switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #cccccc;
  border-radius: 13px;
  transition: background var(--transition);
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--red);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ─── 11. Encuentro de negocios ───────────────────────────── */
.encuentro-section { border-color: var(--border-red); }

.encuentro-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.encuentro-desc strong {
  color: var(--text);
  font-weight: 600;
}

/* ─── 12. Botón de envío ──────────────────────────────────── */
.submit-section {
  background: transparent;
  border: none;
  padding: 8px 0 0;
}

.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 16px 24px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background var(--transition), transform 0.12s ease, box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}

.btn-submit:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(190,30,45,0.3);
}

.btn-submit:hover::before { transform: translateX(100%); }
.btn-submit:active { transform: translateY(0); box-shadow: none; }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-arrow {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.btn-submit:hover .btn-arrow { transform: translateX(3px); }

/* Spinner dentro del botón */
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 4px;
  vertical-align: middle;
}

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

.form-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 14px;
  line-height: 1.5;
}

/* ─── 13. Toast de error ──────────────────────────────────── */
.error-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #fff0f1;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 13px;
  font-family: var(--font);
  padding: 12px 24px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.error-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── 14. Footer ──────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 24px 0 0;
  font-size: 12px;
  color: #aaaaaa;
  letter-spacing: 0.03em;
}

/* ─── 15. Animación de entrada ────────────────────────────── */
.fade-in {
  animation: fadeUp 0.4s ease both;
}

/* ─── 16. Responsive ─────────────────────────────────────── */
@media (max-width: 680px) {
  .form-section { padding: 20px 18px; }
  .row-2, .row-3 { grid-template-columns: 1fr; gap: 0; }
  .tipo-grid { grid-template-columns: 1fr; }
  .tipo-card-inner { flex-direction: row; text-align: left; padding: 14px 16px; }
  .tipo-icon { width: 24px; height: 24px; flex-shrink: 0; }
}

@media (max-width: 480px) {
  .page-wrapper { padding: 0 10px 32px; }
  .site-header { border-radius: 0 0 var(--radius) var(--radius); padding: 20px 14px; }
  .section-label { font-size: 9px; }
  .btn-submit { font-size: 14px; padding: 14px 20px; }
}

/* ─── 17. reCAPTCHA ───────────────────────────────────────── */
.recaptcha-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

/* ─── 18. Checkbox aviso de privacidad ────────────────────── */
.privacy-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  cursor: pointer;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.privacy-check:hover {
  border-color: rgba(190,30,45,0.4);
}

.privacy-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.privacy-check-box {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  margin-top: 1px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.privacy-check input:checked + .privacy-check-box {
  background: var(--red);
  border-color: var(--red);
}

.privacy-check input:checked + .privacy-check-box::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.privacy-check-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

.privacy-check-text a {
  color: var(--red);
  font-weight: 600;
  text-decoration: none;
}

.privacy-check-text a:hover {
  text-decoration: underline;
}
