/* ================================================
   Diagnóstico Empresarial de Empleo Inclusivo
   Main Stylesheet
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary:     #1d4ed8;
  --primary-dark:#1e3a8a;
  --secondary:   #7c3aed;
  --success:     #059669;
  --warning:     #d97706;
  --danger:      #dc2626;
  --info:        #0891b2;
  --light:       #f8fafc;
  --dark:        #0f172a;
  --gray-100:    #f1f5f9;
  --gray-200:    #e2e8f0;
  --gray-300:    #cbd5e1;
  --gray-400:    #94a3b8;
  --gray-500:    #64748b;
  --gray-600:    #475569;
  --gray-700:    #334155;
  --gray-800:    #1e293b;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(0,0,0,.08);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.12);
  --transition:  all .25s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--light);
  color: var(--gray-800);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

/* ── Typography ── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.25; }
.display-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; }
.lead { font-size: 1.1rem; color: var(--gray-500); }

/* ── Navbar ── */
.navbar-custom {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary) !important;
  text-decoration: none;
}
.navbar-brand .brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #312e81 100%);
  color: #fff;
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,.25) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(29,78,216,.3) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #e0e7ff;
  padding: .35rem .9rem;
  border-radius: 100px;
  font-size: .8rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; margin-bottom: 1.2rem; }
.hero .lead { color: rgba(255,255,255,.8); font-size: 1.15rem; }
.hero-stats { margin-top: 3rem; }
.hero-stat {
  text-align: center;
  padding: 1rem;
  background: rgba(255,255,255,.08);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.1);
}
.hero-stat .stat-number { font-size: 1.8rem; font-weight: 800; color: #e0e7ff; }
.hero-stat .stat-label  { font-size: .78rem; color: rgba(255,255,255,.65); text-transform: uppercase; letter-spacing: .05em; }

/* ── Buttons ── */
.btn {
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: .65rem 1.5rem;
  transition: var(--transition);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .9rem;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 4px 14px rgba(29,78,216,.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29,78,216,.45);
  color: #fff;
}
.btn-success {
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  box-shadow: 0 4px 14px rgba(5,150,105,.3);
}
.btn-success:hover { transform: translateY(-2px); color: #fff; }
.btn-outline-primary {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: .4rem 1rem; font-size: .82rem; }

/* ── Cards ── */
.card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 1.25rem 1.5rem;
  font-weight: 700;
}
.card-body { padding: 1.5rem; }
.card-hover { transition: var(--transition); }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* ── Feature Cards (landing) ── */
.feature-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--gray-200);
  transition: var(--transition);
  height: 100%;
}
.feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.2rem;
}
.icon-blue   { background: #eff6ff; color: #2563eb; }
.icon-purple { background: #f5f3ff; color: #7c3aed; }
.icon-green  { background: #ecfdf5; color: #059669; }
.icon-amber  { background: #fffbeb; color: #d97706; }

/* ── Steps ── */
.step-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(29,78,216,.3);
}

/* ── Progress Stepper ── */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
  min-width: 80px;
}
.step-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-200);
  border: 3px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .82rem;
  color: var(--gray-400);
  transition: var(--transition);
  z-index: 1;
  position: relative;
}
.step-dot.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(29,78,216,.15);
}
.step-dot.completed {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.step-label {
  font-size: .7rem;
  color: var(--gray-400);
  margin-top: .4rem;
  text-align: center;
  font-weight: 500;
  max-width: 80px;
}
.step-label.active  { color: var(--primary); font-weight: 600; }
.step-label.completed { color: var(--success); }
.step-connector {
  height: 3px;
  flex: 1;
  background: var(--gray-200);
  margin: 0;
  margin-top: -18px;
  transition: var(--transition);
}
.step-connector.completed { background: var(--success); }

/* ── Question Sections ── */
.stage-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 1.5rem 2rem;
  border-radius: var(--radius) var(--radius) 0 0;
}
.stage-header.purple { background: linear-gradient(135deg, #5b21b6, #7c3aed); }
.stage-header.green  { background: linear-gradient(135deg, #047857, #059669); }

.question-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: var(--transition);
}
.question-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.07); }
.question-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-right: .6rem;
}
.question-text {
  font-weight: 500;
  color: var(--gray-700);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
}
.area-badge {
  font-size: .7rem;
  background: var(--gray-100);
  color: var(--gray-500);
  padding: .2rem .6rem;
  border-radius: 100px;
  font-weight: 600;
  margin-bottom: .75rem;
  display: inline-block;
}

/* ── Radio Options ── */
.opciones-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6rem;
}
@media(max-width:640px) { .opciones-grid { grid-template-columns: repeat(2, 1fr); } }

.opcion-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .75rem .5rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  gap: .4rem;
  user-select: none;
}
.opcion-label input[type="radio"] { display: none; }
.opcion-label .opcion-icon { font-size: 1.3rem; }
.opcion-label .opcion-text { font-size: .75rem; font-weight: 600; color: var(--gray-600); }
.opcion-label .opcion-pts  { font-size: .65rem; color: var(--gray-400); }

.opcion-label:hover { border-color: var(--primary); background: #eff6ff; }
.opcion-label.selected-0 { border-color: #ef4444; background: #fef2f2; }
.opcion-label.selected-0 .opcion-text { color: #ef4444; }
.opcion-label.selected-1 { border-color: #f59e0b; background: #fffbeb; }
.opcion-label.selected-1 .opcion-text { color: #b45309; }
.opcion-label.selected-2 { border-color: #3b82f6; background: #eff6ff; }
.opcion-label.selected-2 .opcion-text { color: #1d4ed8; }
.opcion-label.selected-3 { border-color: #10b981; background: #ecfdf5; }
.opcion-label.selected-3 .opcion-text { color: #059669; }

/* ── Results ── */
.resultado-hero {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  color: #fff;
  padding: 3rem 2rem;
  border-radius: var(--radius);
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
}
.resultado-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(124,58,237,.3) 0%, transparent 70%);
}
.nivel-badge-big {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem 1.5rem;
  border-radius: 100px;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 1rem;
}
.score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 6px solid rgba(255,255,255,.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto;
}
.score-number { font-size: 2.8rem; font-weight: 800; line-height: 1; }
.score-max    { font-size: .85rem; color: rgba(255,255,255,.65); }

.etapa-score-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.etapa-score-card .label { font-size: .8rem; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.etapa-score-card .score { font-size: 1.6rem; font-weight: 800; margin: .25rem 0; }
.progress { height: 10px; border-radius: 100px; background: var(--gray-200); overflow: hidden; }
.progress-bar { transition: width 1s ease-out; border-radius: 100px; }

.rec-card {
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  margin-bottom: 1rem;
}
.rec-header {
  background: var(--gray-50, #f9fafb);
  padding: 1rem 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-200);
}
.rec-header:hover { background: var(--gray-100); }
.rec-body { padding: 1.25rem; }
.rec-body ul { padding-left: 1.2rem; margin: 0; }
.rec-body li { margin-bottom: .6rem; color: var(--gray-700); line-height: 1.5; }
.rec-body li:last-child { margin-bottom: 0; }

/* ── Admin ── */
.admin-sidebar {
  background: var(--dark);
  min-height: 100vh;
  padding: 1.5rem 0;
  position: fixed;
  left: 0;
  top: 0;
  width: 260px;
  overflow-y: auto;
  z-index: 100;
}
.admin-main { margin-left: 260px; padding: 2rem; min-height: 100vh; background: var(--gray-100); }
.sidebar-brand {
  padding: .5rem 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
}
.sidebar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.5rem;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
  font-size: .9rem;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.sidebar-nav a.active { border-left: 3px solid var(--primary); }

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.stat-info .stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; margin-bottom: .2rem; }
.stat-info .stat-name  { font-size: .82rem; color: var(--gray-500); font-weight: 500; }

.table { font-size: .88rem; }
.table th { font-weight: 600; color: var(--gray-600); background: var(--gray-50, #f9fafb); border-bottom: 2px solid var(--gray-200); }
.table td { vertical-align: middle; border-bottom: 1px solid var(--gray-100); }
.badge {
  padding: .3rem .75rem;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 600;
}
.badge-inicial    { background: #fee2e2; color: #dc2626; }
.badge-desarrollo { background: #fef3c7; color: #b45309; }
.badge-gestionado { background: #dbeafe; color: #1d4ed8; }
.badge-lider      { background: #d1fae5; color: #059669; }

/* ── Forms ── */
.form-control, .form-select {
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: .65rem 1rem;
  font-size: .9rem;
  transition: var(--transition);
  font-family: inherit;
  width: 100%;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,.1);
  outline: none;
}
label { font-weight: 500; font-size: .88rem; color: var(--gray-700); margin-bottom: .35rem; display: block; }
.form-group { margin-bottom: 1.25rem; }

/* ── Alerts ── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #059669; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }

/* ── Utilities ── */
.bg-purple       { background-color: #7c3aed !important; }
.text-purple     { color: #7c3aed !important; }
.divider { border: none; border-top: 1px solid var(--gray-200); margin: 2rem 0; }
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.text-muted { color: var(--gray-500) !important; }
.rounded-xl { border-radius: var(--radius) !important; }
.shadow-sm { box-shadow: var(--shadow) !important; }

/* ── Login ── */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.login-card {
  background: #fff;
  border-radius: 18px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp .5s ease forwards; }
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }

/* ── Print Styles ── */
@media print {
  .navbar-custom, .btn, .no-print, .admin-sidebar, nav { display: none !important; }
  .admin-main { margin-left: 0 !important; padding: 0 !important; }
  body { background: #fff; font-size: 12pt; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  .resultado-hero { background: #1e3a8a !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .progress-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rec-body { display: block !important; }
  .page-break { page-break-before: always; }
}

/* ── Responsive ── */
@media(max-width:768px) {
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; padding: 1rem; }
  .hero { padding: 3rem 0 2.5rem; }
  .opciones-grid { grid-template-columns: repeat(2, 1fr); }
  .stepper { gap: 0; }
  .step-label { display: none; }
}

/* ── Nivel Colors ── */
.nivel-inicial    { color: #dc2626; }
.nivel-desarrollo { color: #b45309; }
.nivel-gestionado { color: #1d4ed8; }
.nivel-lider      { color: #059669; }

/* ── File Upload / Other ── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-400);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; display: block; }

.chart-container { position: relative; height: 280px; }

/* ── Navigation form steps ── */
.form-step { display: none; }
.form-step.active { display: block; animation: fadeInUp .35s ease; }

/* ── Navbar alias (used by formulario/resultados) ── */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  flex-wrap: wrap;
  gap: .75rem;
}
.navbar .navbar-brand { font-size: 1rem; }
.brand-logo {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: .9rem;
}

/* ── Outline button variants ── */
.btn-outline {
  background: transparent;
  border: 2px solid var(--gray-300);
  color: var(--gray-600);
}
.btn-outline:hover { background: var(--gray-100); border-color: var(--gray-400); color: var(--gray-800); }
.btn-outline-secondary {
  background: transparent;
  border: 2px solid var(--gray-300);
  color: var(--gray-600);
}
.btn-outline-secondary:hover { background: var(--gray-100); }
