/* ── Paleta oficial Municipio de Huixquilucan 2025-2027 ────── */
:root {
  --primario:       #192075;   /* Azul marino institucional */
  --primario-claro: #1565C0;   /* Azul medio (gradiente H) */
  --primario-hover: #0f1550;
  --cian:           #00C5DC;   /* Cian brillante (palomita del logo) */
  --cian-claro:     #68C2DD;   /* Cian suave para fondos */
  --naranja:        #FFBA44;   /* Dorado/ámbar */
  --naranja-hover:  #FF7A1F;
  --gris:           #F3F5F7;
  --gris-claro:     #FDFDFD;
  --texto:          #010101;
  --borde:          #dce3f0;
  --error:          #c62828;
  --exito:          #2e7d32;   /* Verde solo para indicadores de éxito */
  --aviso:          #e65100;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--gris);
  color: var(--texto);
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────── */
header {
  background: linear-gradient(135deg, var(--primario) 0%, var(--primario-claro) 100%);
  color: white;
  padding: 8px 2rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  box-shadow: 0 3px 10px rgba(0,0,0,.4);
  position: relative;
  min-height: 72px;
}

/* franja cian en la parte inferior del header */
header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cian), var(--cian-claro), var(--cian));
}

header img {
  height: 56px;
  width: auto;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

header .header-text {
  margin-left: auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

header h1 { font-size: 1.15rem; line-height: 1.3; font-weight: 700; }
header p  { font-size: 0.78rem; opacity: .9; color: var(--cian-claro); margin-top: 3px; }

/* ── Container ───────────────────────────────────────────────── */
.container {
  max-width: 880px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* ── Progress bar ────────────────────────────────────────────── */
.progress-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
}

.progress-bar::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--borde);
  z-index: 0;
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  position: relative;
  z-index: 1;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--borde);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  transition: all .3s;
}

.step-indicator.active .step-circle {
  background: var(--primario);
  border-color: var(--primario);
  color: white;
}

.step-indicator.done .step-circle {
  background: var(--naranja);
  border-color: var(--naranja);
  color: white;
}

.step-label {
  font-size: 0.68rem;
  text-align: center;
  color: #757575;
  max-width: 80px;
}

.step-indicator.active .step-label {
  color: var(--primario);
  font-weight: 600;
}

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(25,32,117,.1);
  padding: 2rem;
}

.card h2 {
  color: var(--primario);
  margin-bottom: 0.3rem;
  font-size: 1.3rem;
}

.card .subtitle {
  color: #64748b;
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-grid.full { grid-template-columns: 1fr; }
.col-span-2 { grid-column: span 2; }

.field { display: flex; flex-direction: column; gap: 0.3rem; }

label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #374151;
}

label .req { color: var(--error); }

input, select, textarea {
  border: 1.5px solid var(--borde);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
  background: white;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cian);
  box-shadow: 0 0 0 3px rgba(104,194,221,.2);
}

input.error, select.error { border-color: var(--error); }
input.valid { border-color: var(--exito); }

.field-msg {
  font-size: 0.77rem;
  min-height: 1rem;
}

.field-msg.error   { color: var(--error); }
.field-msg.success { color: var(--exito); }

/* ── CURP widget ─────────────────────────────────────────────── */
.curp-wrapper { position: relative; }

.curp-status {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
}

.curp-info {
  background: #EEF2FF;
  border: 1px solid var(--cian);
  border-radius: 6px;
  padding: 0.65rem 1rem;
  font-size: 0.84rem;
  margin-top: 0.4rem;
  display: none;
}

.curp-info.visible { display: block; }

/* ── CCT badge ───────────────────────────────────────────────── */
.cct-badge {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.cct-badge.publica  { background: #dbeafe; color: #1e40af; }
.cct-badge.privada  { background: #fef3c7; color: #92400e; }

/* ── Document upload grid ────────────────────────────────────── */
.doc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.doc-item {
  border: 2px dashed var(--borde);
  border-radius: 8px;
  padding: 1.2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}

.doc-item:hover {
  border-color: var(--cian);
  background: #f0f9ff;
}

.doc-item.uploaded {
  border-color: var(--exito);
  border-style: solid;
  background: #f0fdf4;
}

.doc-item.requerido-faltante {
  border-color: var(--error);
  background: #fff5f5;
}

.doc-icon    { font-size: 1.8rem; margin-bottom: 0.3rem; }
.doc-title   { font-size: 0.82rem; font-weight: 700; color: #1e293b; }
.doc-subtitle { font-size: 0.73rem; color: #64748b; margin-top: 0.2rem; }
.doc-check   { color: var(--exito); font-weight: bold; }

.doc-item input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Botón "Mismo PDF" dentro de la tarjeta del reverso */
.btn-mismo-pdf {
  position: relative;   /* encima del file-input transparente */
  z-index: 2;
  margin-top: 0.5rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primario);
  background: #EEF2FF;
  border: 1.5px solid var(--primario);
  border-radius: 20px;
  cursor: pointer;
  transition: background .2s;
}
.btn-mismo-pdf:hover { background: #dbeafe; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-group {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  gap: 1rem;
}

.btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.btn-primary {
  background: var(--primario);
  color: white;
}

.btn-primary:hover  { background: var(--primario-hover); }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }

.btn-secondary {
  background: white;
  color: var(--primario);
  border: 2px solid var(--primario);
}

.btn-secondary:hover { background: #EEF2FF; }

/* ── Resumen / confirmación ──────────────────────────────────── */
.resumen {
  background: #F8FAFF;
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--primario);
}

.resumen h3 { color: var(--primario); margin-bottom: 0.8rem; font-size: 1rem; }
.resumen-grid { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; font-size: 0.88rem; }
.resumen-key  { color: #64748b; font-size: 0.8rem; }

.folio-box {
  text-align: center;
  background: linear-gradient(160deg, #EEF2FF 0%, #e0f7fb 100%);
  border: 2px solid var(--primario);
  border-radius: 12px;
  padding: 2.2rem 2rem;
  margin: 1.5rem 0;
  position: relative;
  overflow: hidden;
}

/* banda superior cian decorativa */
.folio-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primario), var(--cian), var(--primario-claro));
}

.folio-box .folio {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primario);
  letter-spacing: 4px;
  font-variant-numeric: tabular-nums;
}

.folio-box p { color: #475569; margin-top: 0.5rem; font-size: 0.88rem; }

/* ── Pantalla de envío exitoso ───────────────────────────────── */
.exito-icono {
  height: 110px;
  width: auto;
  margin-bottom: 1rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.exito-banner {
  background: linear-gradient(135deg, var(--primario) 0%, var(--primario-claro) 100%);
  border-radius: 10px 10px 0 0;
  padding: 1.5rem;
  margin: -2rem -2rem 1.5rem;
  text-align: center;
  position: relative;
}

.exito-banner::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cian), var(--cian-claro), var(--cian));
}

.exito-banner h2 {
  color: white !important;
  font-size: 1.5rem;
  margin: 0.5rem 0 0.25rem;
}

.exito-banner p {
  color: var(--cian-claro);
  font-size: 0.88rem;
  margin: 0;
}

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
  margin-right: 5px;
}

.spinner.dark {
  border-color: rgba(25,32,117,.3);
  border-top-color: var(--primario);
}

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

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 0.8rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.alert-error   { background: #fef2f2; border-left: 4px solid var(--error); color: var(--error); }
.alert-success { background: #f0fdf4; border-left: 4px solid var(--exito); color: var(--exito); }
.alert-info    { background: #EEF2FF; border-left: 4px solid var(--primario); color: var(--primario); }
.alert-warning { background: #fffbeb; border-left: 4px solid var(--naranja); color: #92400e; }

/* ── Section divider ─────────────────────────────────────────── */
.section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primario);
  margin: 1.4rem 0 0.7rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--borde);
  grid-column: span 2;
}

/* ── Responsive: tablet (≤768px) ─────────────────────────────── */
@media (max-width: 768px) {
  .container { margin: 1rem auto; }
  .card { padding: 1.5rem; }
  header { padding: 6px 1rem; }
  header img { height: 46px; }
  header h1 { font-size: 1rem; }
  .exito-icono { height: 90px; }
}

/* ── Responsive: mobile (≤600px) ────────────────────────────── */
@media (max-width: 600px) {
  .container { margin: 0 auto; padding: 0 0.5rem; }

  header { padding: 5px 0.75rem; gap: 0.6rem; }
  header img { height: 38px; }
  header h1 { font-size: 0.78rem; }
  header p  { font-size: 0.68rem; }
  .exito-icono { height: 75px; }
  .exito-banner { margin: -1rem -0.85rem 1.2rem; padding: 1.2rem; }

  .card { padding: 1rem 0.85rem; border-radius: 8px; margin-bottom: 1rem; }
  .card h2 { font-size: 1.1rem; }
  .card .subtitle { font-size: 0.82rem; margin-bottom: 1rem; }

  .progress-bar { margin-bottom: 1rem; }
  .step-circle { width: 32px; height: 32px; font-size: 0.75rem; }
  .step-label { display: none; }

  .form-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .col-span-2 { grid-column: span 1; }
  .section-title { grid-column: span 1; margin: 1rem 0 0.5rem; }

  .doc-grid { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .doc-item { padding: 0.9rem 0.6rem; }
  .doc-icon { font-size: 1.4rem; }
  .doc-title { font-size: 0.75rem; }
  .doc-subtitle { font-size: 0.68rem; }

  .btn-group { flex-direction: column-reverse; gap: 0.6rem; margin-top: 1.5rem; }
  .btn { width: 100%; padding: 0.75rem 1rem; }

  .resumen-grid { font-size: 0.82rem; }
  .folio-box { padding: 1.2rem; }
  .folio-box .folio { font-size: 1.5rem; letter-spacing: 2px; }
}
