/* =============================================
   BRIEF CONTROLTECH DEL BAJÍO — STEP FORM
   Estilos principales — VIM MARKETING
   Archivo: css/styles.css
   
   Rediseño: legibilidad mejorada, tipografía
   más amplia, espaciado generoso y jerarquía
   visual clara.
============================================= */

/* ── VARIABLES GLOBALES ── */
:root {
  /* Paleta VIM Marketing */
  --vim-blue:     #0078C9;
  --vim-blue-dk:  #005fa3;
  --vim-blue-lt:  #e8f4fc;
  --vim-blue-mid: #b3d8f5;
  --vim-blue-10:  rgba(0,120,201,0.10);
  --vim-blue-06:  rgba(0,120,201,0.06);

  /* Superficies */
  --bg:           #f0f4f8;
  --surface:      #ffffff;
  --surface-alt:  #f7f9fb;
  --border:       #dce3eb;
  --border-lt:    #e9eff5;

  /* Texto */
  --text:         #111827;
  --text-sec:     #475569;
  --text-muted:   #7c8ca1;

  /* Estado */
  --success:      #059669;
  --success-lt:   rgba(5,150,105,0.08);
  --danger:       #dc2626;
  --danger-lt:    rgba(220,38,38,0.06);

  /* Tipografía */
  --font:         'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Sombras */
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow:       0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg:    0 12px 40px rgba(0,0,0,0.10);
  --shadow-blue:  0 4px 16px rgba(0,120,201,0.20);

  /* Radios */
  --radius:       14px;
  --radius-sm:    10px;
  --radius-xs:    8px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── FONDO DECORATIVO SUTIL ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 40% at 20% 0%, rgba(0,120,201,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 50% 30% at 80% 100%, rgba(0,120,201,0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ══════════════════════════════════════════
   HEADER — Encabezado principal
══════════════════════════════════════════ */
header {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, var(--vim-blue) 0%, var(--vim-blue-dk) 100%);
  padding: 44px 28px 40px;
  text-align: center;
  overflow: hidden;
}

/* Círculos decorativos del header */
header::before, header::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
header::before {
  width: 360px; height: 360px;
  top: -140px; right: -80px;
  background: rgba(255,255,255,0.06);
}
header::after {
  width: 220px; height: 220px;
  bottom: -100px; left: -50px;
  background: rgba(255,255,255,0.04);
}

/* ── Badge de marca ── */
.logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 100px;
  padding: 6px 18px 6px 12px;
  margin-bottom: 20px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.logo-badge .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: blink 2.5s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

/* ── Título del header ── */
header h1 {
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 6px;
}

header h1 span {
  display: block;
  font-size: clamp(16px, 2.2vw, 21px);
  font-weight: 500;
  opacity: 0.70;
  margin-top: 6px;
  letter-spacing: 0;
}

header p {
  color: rgba(255,255,255,0.65);
  font-size: 16px;
  max-width: 480px;
  margin: 10px auto 0;
  line-height: 1.5;
}

/* ══════════════════════════════════════════
   STEPPER — Barra de pasos sticky
══════════════════════════════════════════ */
.stepper-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-lt);
  padding: 16px 16px 0;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
  overflow: hidden;
}

.stepper {
  display: flex;
  align-items: flex-start;
  max-width: 720px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 16px;
  padding-left: 4px;
  padding-right: 4px;
}
.stepper::-webkit-scrollbar { display: none; }

/* ── Línea conectora entre pasos ── */
.step-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-top: 17px;
  transition: background 0.4s ease;
  min-width: 8px;
}
.step-connector.done { background: var(--vim-blue); }

/* ── Paso individual ── */
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  min-width: 0;
}

.step-circle {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.step-circle .check-icon { display: none; font-size: 13px; }

/* Paso completado */
.step-item.done .step-circle {
  background: var(--vim-blue);
  border-color: var(--vim-blue);
  color: #fff;
}
.step-item.done .step-circle .step-num   { display: none; }
.step-item.done .step-circle .check-icon { display: block; }

/* Paso activo */
.step-item.active .step-circle {
  background: var(--vim-blue);
  border-color: var(--vim-blue);
  color: #fff;
  box-shadow: 0 0 0 4px var(--vim-blue-lt);
}

.step-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: color 0.3s;
}
.step-item.active .step-label,
.step-item.done  .step-label { color: var(--vim-blue); }

/* ── Barra de progreso global ── */
.progress-bar-wrap {
  height: 3px;
  background: var(--border-lt);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 12.5%;
  background: linear-gradient(90deg, var(--vim-blue), #4db8ff);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ══════════════════════════════════════════
   CONTENEDOR PRINCIPAL
══════════════════════════════════════════ */
main {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 100px;
}

/* ══════════════════════════════════════════
   TARJETA DE STEP
══════════════════════════════════════════ */
.step-card {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border-lt);
  border-radius: 20px;
  padding: 44px 44px 40px;
  box-shadow: var(--shadow);
}

.step-card.active {
  display: block;
  animation: slideIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}

.step-card.anim-prev {
  animation: slideInLeft 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@media (max-width: 600px) {
  .step-card { padding: 28px 20px 28px; }
}

/* ── Encabezado de cada step ── */
.step-card-header { margin-bottom: 32px; }

.step-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: var(--vim-blue);
  background: var(--vim-blue-lt);
  border-radius: 6px;
  padding: 4px 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.step-card-header h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.step-card-header p {
  font-size: 16px;
  color: var(--text-sec);
  margin-top: 6px;
  line-height: 1.5;
}

/* ══════════════════════════════════════════
   CAMPOS DE FORMULARIO
══════════════════════════════════════════ */
.field-group { display: grid; gap: 24px; }

.field-group.two-col { grid-template-columns: 1fr 1fr; }

@media (max-width: 600px) {
  .field-group.two-col { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 8px; }

/* ── Labels — más grandes y legibles ── */
.field label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
}

.field label .req {
  color: var(--danger);
  font-size: 16px;
  line-height: 1;
}

.field-hint {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: -4px;
  line-height: 1.4;
}

/* ── Inputs — tamaño cómodo, 16px evita zoom iOS ── */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea,
select {
  width: 100%;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.5;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--vim-blue);
  box-shadow: 0 0 0 3px var(--vim-blue-10);
  background: #fff;
}

input::placeholder, textarea::placeholder {
  color: #a3b1c1;
  font-size: 15px;
}

textarea {
  resize: vertical;
  min-height: 110px;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 44px;
  cursor: pointer;
}

/* ══════════════════════════════════════════
   OPCIONES — Radio / Checkbox pills
══════════════════════════════════════════ */
.options-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.opt-label {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 11px 18px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-sec);
  transition: all 0.18s ease;
  user-select: none;
  line-height: 1.3;
}

.opt-label:hover {
  border-color: var(--vim-blue);
  color: var(--vim-blue);
  background: var(--vim-blue-lt);
}

.opt-label input { display: none; }

.opt-label.selected {
  background: var(--vim-blue-lt);
  border-color: var(--vim-blue);
  color: var(--vim-blue);
  font-weight: 700;
}

/* ══════════════════════════════════════════
   VALIDACIÓN — Errores en campos
══════════════════════════════════════════ */
.field.error input,
.field.error textarea,
.field.error select {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-lt);
}

.field .error-msg {
  display: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--danger);
  line-height: 1.3;
}
.field.error .error-msg { display: block; }

/* ══════════════════════════════════════════
   NAVEGACIÓN ENTRE STEPS
══════════════════════════════════════════ */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border-lt);
  gap: 12px;
}

.step-counter {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.step-counter strong {
  color: var(--vim-blue);
  font-weight: 800;
}

/* ── Botones de navegación ── */
.btn-prev, .btn-next, .btn-submit {
  font-family: var(--font);
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 15px;
  padding: 13px 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.btn-prev {
  background: var(--surface-alt);
  color: var(--text-sec);
  border: 1.5px solid var(--border);
}
.btn-prev:hover {
  background: var(--border-lt);
  color: var(--text);
}
.btn-prev.hidden { visibility: hidden; pointer-events: none; }

.btn-next, .btn-submit {
  background: var(--vim-blue);
  color: #fff;
  box-shadow: var(--shadow-blue);
}
.btn-next:hover, .btn-submit:hover {
  background: var(--vim-blue-dk);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(0,120,201,0.28);
}
.btn-next:active, .btn-submit:active { transform: translateY(0); }
.btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ══════════════════════════════════════════
   MODAL DE ÉXITO
══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }

.modal-box {
  background: var(--surface);
  border-radius: 22px;
  padding: 56px 44px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  transform: scale(0.92) translateY(16px);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.show .modal-box { transform: scale(1) translateY(0); }

.modal-icon {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--success-lt);
  border: 2px solid var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  font-size: 34px;
  color: var(--success);
}

.modal-box h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.modal-box p {
  color: var(--text-sec);
  font-size: 16px;
  line-height: 1.6;
}

.btn-close-modal {
  margin-top: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--vim-blue-lt);
  color: var(--vim-blue);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  padding: 12px 30px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--vim-blue-mid);
  cursor: pointer;
  transition: background 0.2s;
}
.btn-close-modal:hover { background: #d0e8f7; }

/* ══════════════════════════════════════════
   ALERTA ERROR GLOBAL
══════════════════════════════════════════ */
.alert-error {
  background: #fef2f2;
  border: 1.5px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 15px;
  font-weight: 500;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: none;
  line-height: 1.5;
}
.alert-error.show { display: block; }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
footer {
  text-align: center;
  padding: 28px;
  background: var(--surface);
  border-top: 1px solid var(--border-lt);
  font-size: 14px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}
footer span {
  color: var(--vim-blue);
  font-weight: 700;
}