/* ═══════════════════════════════════════════
   PRIMEFIT — Sistema de diseño
   Importar en todas las páginas del proyecto
   ═══════════════════════════════════════════ */

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface2: #f0f1f7;
  --border: #e2e5ef;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-glow: rgba(79, 70, 229, 0.10);
  --green: #16a34a;
  --yellow: #b45309;
  --red: #dc2626;
  --gray: #6b7280;
  --blue: #3b82f6;
  --orange: #f97316;
  --bronze: #cd7f32;
  --silver: #a0a0a0;
  --gold: #fbbf24;
  --text: #1e2235;
  --muted: #6b7280;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.2);
  --fuente: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Botones ── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--fuente);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--fuente);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s;
}
.btn-secondary:hover { border-color: var(--accent); }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* ── Secciones del formulario ── */
.modal-section {
  margin-bottom: 20px;
}
.modal-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  margin-bottom: 12px;
}

/* ── Campos ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}
.form-group:last-child { margin-bottom: 0; }

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.form-label-required::after {
  content: ' *';
  color: var(--red);
}

.form-input,
.form-select,
.form-textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--fuente);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--red);
}
.form-textarea { resize: vertical; min-height: 72px; }

.field-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 2px;
}

/* ── Hint de precio por pago ── */
.precio-hint {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 4px;
}

/* ── Error global en formulario ── */
.form-error-global {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--red);
  margin-bottom: 16px;
  display: none;
}
.form-error-global.visible { display: block; }

/* ── Botones del footer del modal ── */
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── Pantalla de éxito ── */
.exito-screen {
  text-align: center;
  padding: 8px 0;
}
.exito-icon { font-size: 48px; margin-bottom: 12px; }
.exito-titulo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.exito-resumen {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}
.exito-link-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  margin-bottom: 6px;
}
.exito-link-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--muted);
  background: var(--surface2);
  box-sizing: border-box;
  margin-bottom: 6px;
}
.exito-preview-label {
  font-size: 11px;
  color: var(--muted);
  text-align: left;
  margin-bottom: 4px;
}
.exito-preview {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text);
  text-align: left;
  font-style: italic;
  margin-bottom: 20px;
}
.exito-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.btn-whatsapp {
  background: #25D366;
  color: #fff;
  border: none;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--fuente);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-whatsapp:hover { background: #1ebe59; }

/* ── Responsive ── */
@media (max-width: 540px) {
  .modal { padding: 20px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .exito-btns { grid-template-columns: 1fr; }
  .modal-footer { flex-direction: column-reverse; }
}
