/* ═══════════════════════════════════════════════════════════
   IPL — ÍNDICE DE PERCEPCIÓN DE LIDERAZGO
   Design System & Global Styles
   ═══════════════════════════════════════════════════════════ */

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

:root {
  --primary: #0f172a;
  --primary-light: #1e293b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #dbeafe;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
  --transition: all 0.2s ease;
}

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

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-icon { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: var(--gray-700); border: 1.5px solid var(--gray-300); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.btn-ghost { background: transparent; color: var(--gray-500); padding: 8px 12px; }
.btn-ghost:hover { color: var(--gray-800); background: var(--gray-100); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: var(--white); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* ═══════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 20px;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--gray-300); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-title { font-size: 16px; font-weight: 700; color: var(--gray-800); }
.card-subtitle { font-size: 13px; color: var(--gray-500); }
.card-actions { display: flex; gap: 8px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* ═══════════════════════════════════════════════════════════
   BADGES & TAGS
   ═══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}
.badge-blue { background: var(--accent-light); color: #1d4ed8; }
.badge-green { background: var(--success-light); color: #065f46; }
.badge-yellow { background: var(--warning-light); color: #92400e; }
.badge-red { background: var(--danger-light); color: #991b1b; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--gray-100);
  color: var(--gray-600);
  margin: 2px;
}

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; color: var(--gray-800); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ═══════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
  grid-column: 1 / -1;
}
.empty-state p { font-size: 15px; }

/* ═══════════════════════════════════════════════════════════
   HOME PAGE
   ═══════════════════════════════════════════════════════════ */
.home-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
}
.home-bg-shapes { position: absolute; inset: 0; overflow: hidden; }
.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.07;
  background: var(--accent);
}
.shape-1 { width: 600px; height: 600px; top: -200px; right: -100px; animation: float 20s infinite ease-in-out; }
.shape-2 { width: 400px; height: 400px; bottom: -100px; left: -100px; animation: float 15s infinite ease-in-out reverse; }
.shape-3 { width: 300px; height: 300px; top: 40%; left: 50%; animation: float 25s infinite ease-in-out; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}
.home-content {
  position: relative;
  text-align: center;
  padding: 40px;
  max-width: 560px;
}
.home-logo { margin-bottom: 32px; }
.logo-icon {
  width: 72px; height: 72px;
  margin: 0 auto 16px;
  background: rgba(59, 130, 246, 0.15);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.logo-icon svg { width: 40px; height: 40px; }
.home-title {
  font-size: 48px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -1px;
  line-height: 1;
}
.home-subtitle {
  font-size: 16px;
  color: var(--accent);
  font-weight: 500;
  margin-top: 8px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.home-desc {
  font-size: 15px;
  color: var(--gray-400);
  line-height: 1.7;
  margin-bottom: 36px;
}
.home-actions { display: flex; flex-direction: column; gap: 12px; }
.home-actions .btn-primary {
  background: var(--accent);
  padding: 16px 32px;
  font-size: 16px;
  border-radius: var(--radius);
}
.home-actions .btn-outline {
  color: var(--gray-400);
  border-color: rgba(255,255,255,0.15);
  padding: 14px 32px;
  border-radius: var(--radius);
}
.home-actions .btn-outline:hover { border-color: var(--accent); color: var(--accent); background: rgba(59,130,246,0.1); }

/* ═══════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════ */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  padding: 20px;
  position: relative;
}
.btn-back {
  position: absolute;
  top: 24px; left: 24px;
  background: none; border: none;
  color: var(--gray-500);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}
.btn-back:hover { color: var(--accent); }
.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}
.login-header { text-align: center; margin-bottom: 28px; }
.login-icon { font-size: 40px; margin-bottom: 12px; }
.login-header h2 { font-size: 22px; font-weight: 700; color: var(--gray-800); }
.login-header p { font-size: 14px; color: var(--gray-500); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════
   ADMIN LAYOUT
   ═══════════════════════════════════════════════════════════ */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 260px;
  background: var(--primary);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
}
.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo { font-size: 24px; font-weight: 800; letter-spacing: -1px; }
.sidebar-badge {
  font-size: 10px;
  font-weight: 600;
  background: var(--accent);
  color: var(--white);
  padding: 2px 8px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--gray-400);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-align: left;
  width: 100%;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--gray-200); }
.nav-item.active { background: rgba(59, 130, 246, 0.15); color: var(--accent); }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-footer .btn-ghost { color: var(--gray-400); width: 100%; justify-content: flex-start; }
.sidebar-footer .btn-ghost:hover { color: var(--white); background: rgba(255,255,255,0.06); }

.admin-main {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  max-width: 1200px;
}
.admin-tab { display: none; }
.admin-tab.active { display: block; }
.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}
.tab-header h2 { font-size: 24px; font-weight: 700; color: var(--gray-800); }
.tab-desc { font-size: 14px; color: var(--gray-500); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════
   SURVEY PAGE
   ═══════════════════════════════════════════════════════════ */
.survey-container {
  min-height: 100vh;
  background: var(--gray-50);
  padding: 20px;
}
.survey-wrapper {
  max-width: 720px;
  margin: 0 auto;
}
.survey-header {
  text-align: center;
  padding: 32px 20px;
  margin-bottom: 24px;
}
.survey-header h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-800);
  letter-spacing: -0.5px;
}
.survey-header p { font-size: 14px; color: var(--gray-500); margin-top: 8px; }

.survey-progress {
  background: var(--gray-200);
  border-radius: 50px;
  height: 6px;
  margin-bottom: 32px;
  overflow: hidden;
}
.survey-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 50px;
  transition: width 0.4s ease;
}

.survey-step { display: none; }
.survey-step.active { display: block; }

.survey-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 32px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.survey-dim-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 8px;
}

.survey-question {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.5;
  margin-bottom: 20px;
}

.likert-scale {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.likert-option {
  flex: 1;
  max-width: 100px;
  text-align: center;
}
.likert-option input { display: none; }
.likert-option label {
  display: block;
  padding: 12px 8px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
}
.likert-option label .likert-num { font-size: 20px; display: block; color: var(--gray-600); }
.likert-option label .likert-text { font-size: 10px; color: var(--gray-400); display: block; margin-top: 4px; }
.likert-option input:checked + label {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}
.likert-option input:checked + label .likert-num { color: var(--accent); }
.likert-option input:checked + label .likert-text { color: #1d4ed8; }
.likert-option label:hover { border-color: var(--gray-300); background: var(--gray-50); }

.survey-nav { display: flex; justify-content: space-between; margin-top: 24px; }

.survey-select-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.survey-select-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }

.leader-found {
  background: var(--accent-light);
  border: 1px solid #93c5fd;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.leader-found .leader-avatar {
  width: 48px; height: 48px;
  background: var(--accent);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}
.leader-found .leader-info h4 { font-size: 16px; font-weight: 700; color: var(--gray-800); }
.leader-found .leader-info p { font-size: 13px; color: var(--gray-500); }

.leader-not-found {
  background: var(--warning-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  font-size: 14px;
  color: #92400e;
}

/* ═══════════════════════════════════════════════════════════
   THANKS PAGE
   ═══════════════════════════════════════════════════════════ */
.thanks-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  text-align: center;
  padding: 40px;
}
.thanks-content { max-width: 480px; }
.thanks-icon { font-size: 64px; margin-bottom: 20px; }
.thanks-content h1 { font-size: 32px; font-weight: 800; color: var(--white); margin-bottom: 12px; }
.thanks-content p { font-size: 15px; color: var(--gray-400); line-height: 1.7; margin-bottom: 32px; }

/* ═══════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════ */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 20px;
}
.stat-label { font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 32px; font-weight: 800; color: var(--gray-800); margin-top: 4px; }
.stat-sub { font-size: 13px; color: var(--gray-400); margin-top: 2px; }

.dash-section { margin-bottom: 28px; }
.dash-section h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gray-100);
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}
.dash-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.dash-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-100);
}
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background: var(--gray-50); }

.ipl-bar-container { display: flex; align-items: center; gap: 10px; }
.ipl-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--gray-100);
  border-radius: 50px;
  overflow: hidden;
}
.ipl-bar {
  height: 100%;
  border-radius: 50px;
  transition: width 0.6s ease;
}
.ipl-bar.green { background: var(--success); }
.ipl-bar.yellow { background: var(--warning); }
.ipl-bar.red { background: var(--danger); }

.ipl-value { font-weight: 700; font-size: 16px; min-width: 40px; }
.ipl-value.green { color: var(--success); }
.ipl-value.yellow { color: var(--warning); }
.ipl-value.red { color: var(--danger); }

.zona-badge { padding: 4px 12px; border-radius: 50px; font-size: 12px; font-weight: 600; }
.zona-verde { background: var(--success-light); color: #065f46; }
.zona-amarilla { background: var(--warning-light); color: #92400e; }
.zona-roja { background: var(--danger-light); color: #991b1b; }

.open-responses {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}
.open-response-item {
  padding: 16px;
  border-bottom: 1px solid var(--gray-100);
}
.open-response-item:last-child { border-bottom: none; }
.open-response-meta { font-size: 12px; color: var(--gray-400); margin-bottom: 4px; }
.open-response-text { font-size: 14px; color: var(--gray-700); font-style: italic; }

/* Questions admin */
.question-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.question-num {
  width: 28px; height: 28px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.question-text { flex: 1; font-size: 14px; color: var(--gray-700); }
.question-edit-input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  background: var(--accent-glow);
}
.dim-section { margin-bottom: 24px; }
.dim-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent-light);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .admin-sidebar {
    width: 100%;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px;
  }
  .sidebar-header { padding: 8px 12px; border-bottom: none; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 4px; }
  .nav-item { padding: 8px 12px; font-size: 12px; }
  .nav-item svg { width: 16px; height: 16px; }
  .sidebar-footer { display: none; }
  .admin-layout { flex-direction: column; }
  .admin-main { margin-left: 0; padding: 16px; }
  .tab-header { flex-direction: column; gap: 12px; }
  .cards-grid { grid-template-columns: 1fr; }
  .likert-scale { flex-wrap: wrap; }
  .likert-option { min-width: 60px; }
  .home-title { font-size: 36px; }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
}
