/* ── Reset y variables ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red-900: #2b0218;
  --red-800: #4a081f;
  --red-700: #7a0b2e;
  --red-600: #bb0c3d;
  --red-500: #e33b56;
  --red-100: #fee2e6;
  --red-50:  #fff1f3;

  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;

  --green-500: #22c55e;
  --orange-400:#fb923c;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:    0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.08);

  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition: 0.2s ease;
}

html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-900);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Cabecera ───────────────────────────────────────────────────────────── */
.header {
  background: var(--red-800);
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 600;
  font-size: 1rem;
}
.brand-icon { width: 22px; height: 22px; flex-shrink: 0; }
.header-user { display: flex; align-items: center; gap: .75rem; }
.user-badge {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: #aed6f1;
}
.user-badge svg { width: 16px; height: 16px; }

/* ── Contenido principal ────────────────────────────────────────────────── */
.main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Alertas ────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  border-radius: var(--radius);
  font-size: .9rem;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.alert-error  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-close  { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 1rem; color: inherit; opacity: .6; }
.alert-close:hover { opacity: 1; }

/* ── Tarjetas ───────────────────────────────────────────────────────────── */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2rem;
}
.card-center {
  text-align: center;
  max-width: 520px;
  margin: 3rem auto;
  padding: 3rem 2.5rem;
}
.card-icon-wrap {
  width: 72px; height: 72px;
  background: var(--red-50);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}
.card-icon-wrap svg { width: 36px; height: 36px; color: var(--red-600); }
.card-title { font-size: 1.5rem; font-weight: 700; margin-bottom: .75rem; color: var(--gray-900); }
.card-desc  { color: var(--gray-500); line-height: 1.6; margin-bottom: 2rem; }

/* ── Estadísticas ───────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.stat-item {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.5rem;
  flex: 1;
  min-width: 140px;
  text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 700; color: var(--red-700); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--gray-500); margin-top: .25rem; text-transform: uppercase; letter-spacing: .05em; }

/* ── Formulario ─────────────────────────────────────────────────────────── */
.section-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--gray-100);
}
.report-form { display: flex; flex-direction: column; gap: 1.5rem; }

.fieldset { border: none; }
.fieldset-legend {
  font-size: .85rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 1rem;
}

/* Radio cards */
.radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: .75rem;
}
.radio-card { cursor: pointer; }
.radio-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1.25rem 1rem;
  border: 2px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.radio-card-inner svg { width: 28px; height: 28px; color: var(--gray-500); transition: color var(--transition); }
.radio-card-title { font-weight: 600; font-size: .9rem; }
.radio-card-desc  { font-size: .78rem; color: var(--gray-500); line-height: 1.4; }

.radio-card input:checked + .radio-card-inner {
  border-color: var(--red-500);
  background: var(--red-50);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.radio-card input:checked + .radio-card-inner svg { color: var(--red-600); }
.radio-card:hover .radio-card-inner { border-color: var(--red-300, #93c5fd); }

/* Selector de segmentación */
.segment-wrap { display: flex; flex-direction: column; gap: .5rem; }
.form-label { font-size: .85rem; font-weight: 600; color: var(--gray-700); }
.form-select {
  padding: .65rem .9rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  color: var(--gray-900);
  background: white;
  cursor: pointer;
  transition: border-color var(--transition);
  max-width: 360px;
}
.form-select:focus { outline: none; border-color: var(--red-500); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }

/* Acciones */
.form-actions { display: flex; justify-content: flex-end; }

/* ── Barra de progreso ──────────────────────────────────────────────────── */
.progress-wrap {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.progress-bar {
  height: 8px;
  background: var(--gray-100);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red-600), var(--red-500));
  border-radius: 99px;
  transition: width .4s ease;
  animation: progress-pulse 1.5s ease-in-out infinite;
}
@keyframes progress-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .7; }
}
.progress-text { font-size: .85rem; color: var(--gray-500); text-align: center; }

/* ── Botones ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.btn-primary {
  background: var(--red-700);
  color: white;
}
.btn-primary:hover { background: var(--red-600); box-shadow: var(--shadow-sm); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-outline {
  background: transparent;
  color: white;
  border: 1.5px solid rgba(255,255,255,.4);
}
.btn-outline:hover { background: rgba(255,255,255,.1); }
.btn-sm  { padding: .4rem .8rem; font-size: .82rem; }
.btn-lg  { padding: .75rem 1.5rem; font-size: 1rem; }

/* ── Dashboard ──────────────────────────────────────────────────────────── */
.dashboard { display: flex; flex-direction: column; gap: 1.5rem; }

/* ── Pie ────────────────────────────────────────────────────────────────── */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  font-size: .8rem;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-100);
  background: white;
}
.footer-brand { display: inline-flex; flex-shrink: 0; }
.footer-logo { height: 50px; width: auto; }

/* ── Fila de formulario (label + select en línea) ───────────────────────── */
.form-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.form-row .form-label { white-space: nowrap; margin: 0; }
.form-row .form-select { flex: 1; max-width: 360px; }

/* ── Utilidades ─────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsivo ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .header-inner { padding: 0 1rem; }
  .main { padding: 1.25rem 1rem; }
  .card { padding: 1.5rem 1.25rem; }
  .radio-grid { grid-template-columns: 1fr 1fr; }
  .form-actions { justify-content: stretch; }
  .form-actions .btn { width: 100%; justify-content: center; }
}
