/**
 * main.css — Estilos compartidos por la app del formulario (app.html / index.php)
 */

/* ── VARIABLES CSS ────────────────────────────────────────────────────────── */
:root {
  --bg:           #f0f5fb;              /* Fondo general (azul muy claro) */
  --surface:      #ffffff;             /* Fondo de tarjetas e inputs */
  --ink:          #0d1a2e;             /* Texto principal (navy oscuro) */
  --ink-soft:     #4a6b88;             /* Texto secundario (azul apagado) */
  --accent:       #005aba;             /* Azul primario corporativo */
  --accent-light: rgba(0,90,186,.08);  /* Fondo suave del acento */
  --border:       #c5d5e8;             /* Bordes */
  --step-done:    #16a34a;             /* Verde para pasos completados */
}

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

/* ── BODY ───────────────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  background-image: none;
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  padding: 0 0 80px;
}

/* ── HEADER ─────────────────────────────────────────────────────────────── */
header {
  background: #004aad;
  color: white;
  padding: 48px 40px 40px;
  position: relative;
  overflow: hidden;
}

/* Resplandor decorativo de fondo (simula el nodo central de la red) */
header::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, transparent 70%);
  opacity: 0.08;
}

header .tag {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #64a0c8;
  margin-bottom: 16px;
  font-weight: 500;
}

header h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.1;
  margin-bottom: 16px;
}

header h1 em {
  font-style: italic;
  color: #64a0c8;
}

header p {
  color: rgba(255,255,255,.80);
  font-size: 15px;
  max-width: 500px;
  line-height: 1.7;
}

/* ── BARRA DE PROGRESO ──────────────────────────────────────────────────── */
.progress-bar {
  background: #003d9a;
  padding: 0 40px 24px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.progress-bar .step {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,.10);
  border-radius: 2px;
  transition: background 0.4s;
  cursor: pointer;
}

.progress-bar .step.active {
  background: var(--accent);
}

.progress-bar .step.done {
  background: var(--step-done);
}

/* ── CONTENEDOR PRINCIPAL ───────────────────────────────────────────────── */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── SECCIONES DEL FORMULARIO ───────────────────────────────────────────── */
.section {
  display: none;
  animation: fadeUp 0.4s ease;
}

.section.visible {
  display: block;
}

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

.section-header {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.section-number {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}

.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  line-height: 1.2;
}

.section-desc {
  color: var(--ink-soft);
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.7;
}

/* ── CAMPOS DEL FORMULARIO ──────────────────────────────────────────────── */
.field {
  margin-bottom: 28px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
  color: var(--ink);
}

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

label .hint {
  font-weight: 300;
  color: var(--ink-soft);
  font-size: 12px;
  margin-left: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
select,
textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-soft);
  opacity: 0.7;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* Flecha SVG del select adaptada al tema oscuro */
select {
  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='%2364a0c8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

/* Opciones del select */
select option {
  background: #ffffff;
  color: #0d1a2e;
}

/* ── GRUPOS DE CHECKBOX Y RADIO ─────────────────────────────────────────── */
.check-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

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

.check-item {
  position: relative;
}

.check-item input {
  display: none;
}

.check-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 300;
  transition: all 0.2s;
  margin: 0;
  color: var(--ink);
}

.check-item label::before {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  transition: all 0.2s;
}

.check-item input[type="radio"] + label::before {
  border-radius: 50%;
}

.check-item input:checked + label {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--ink);
}

.check-item input:checked + label::before {
  background: var(--accent);
  border-color: var(--accent);
}

/* ── SELECTOR DE COLORES ────────────────────────────────────────────────── */
.color-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.color-swatch {
  position: relative;
}

.color-swatch input[type="checkbox"] {
  display: none;
}

.color-swatch label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin: 0;
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 400;
}

.color-swatch .dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
}

.color-swatch input:checked + label .dot {
  border-color: var(--accent);
  transform: scale(1.15);
}

/* ── ZONA DE UPLOAD ─────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--surface);
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.upload-zone input {
  display: none;
}

.upload-zone .icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.upload-zone p {
  font-size: 13px;
  color: var(--ink-soft);
}

.upload-zone span {
  color: var(--accent);
  font-weight: 500;
}

#file-list {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-soft);
}

/* ── SEPARADOR ──────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* ── NAVEGACIÓN ENTRE PASOS ─────────────────────────────────────────────── */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.btn {
  padding: 13px 28px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  letter-spacing: 0.2px;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: #0066cc;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,90,186,.45);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ── PANTALLA DE ÉXITO ──────────────────────────────────────────────────── */
#success {
  display: none;
  text-align: center;
  padding: 80px 20px;
  animation: fadeUp 0.5s ease;
}

#success .icon {
  font-size: 56px;
  margin-bottom: 24px;
}

#success h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 32px;
  margin-bottom: 16px;
}

#success p {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
  max-width: 420px;
  margin: 0 auto;
}

/* ── RESPONSIVE (< 600px) ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  header {
    padding: 36px 20px 32px;
  }

  .progress-bar {
    padding: 0 20px 20px;
  }

  .check-group,
  .check-group.cols-2 {
    grid-template-columns: 1fr;
  }
}
