/* ═══════════════════════════════════════════════════════
   SCRUM MASTER SIMULATOR — Premium Dark Theme
   ═══════════════════════════════════════════════════════ */

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

:root {
  /* Palette */
  --bg-deep: #06060f;
  --bg-surface: #0d0d1a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 212, 255, 0.3);

  /* Text */
  --text-primary: #f0f0f5;
  --text-secondary: #9a9ab0;
  --text-muted: #5a5a72;

  /* Accent */
  --accent-cyan: #00d4ff;
  --accent-violet: #7c3aed;
  --accent-pink: #f472b6;
  --accent-green: #34d399;
  --accent-red: #f87171;
  --accent-amber: #fbbf24;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
  --gradient-success: linear-gradient(135deg, #34d399 0%, #059669 100%);
  --gradient-danger: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
  --gradient-warm: linear-gradient(135deg, #7c3aed 0%, #f472b6 100%);

  /* Sizing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Shadows */
  --shadow-glow-cyan: 0 0 30px rgba(0, 212, 255, 0.15);
  --shadow-glow-violet: 0 0 30px rgba(124, 58, 237, 0.15);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ─── Background Particles ─── */
.bg-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.12;
  animation: float 20s infinite ease-in-out;
}

.p1 { width: 400px; height: 400px; background: var(--accent-cyan); top: -100px; left: -100px; animation-delay: 0s; }
.p2 { width: 300px; height: 300px; background: var(--accent-violet); top: 50%; right: -80px; animation-delay: -5s; }
.p3 { width: 200px; height: 200px; background: var(--accent-pink); bottom: -50px; left: 30%; animation-delay: -10s; }
.p4 { width: 150px; height: 150px; background: var(--accent-cyan); top: 30%; left: 60%; animation-delay: -3s; filter: blur(60px); }
.p5 { width: 250px; height: 250px; background: var(--accent-violet); bottom: 20%; right: 20%; animation-delay: -7s; filter: blur(80px); }
.p6 { width: 180px; height: 180px; background: var(--accent-pink); top: 10%; right: 30%; animation-delay: -12s; filter: blur(70px); }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(15px, 10px) scale(1.02); }
}

/* ─── Glass Card ─── */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ─── Vistas ─── */
.vista {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  animation: fadeSlideIn 0.5s ease-out;
}

.vista.active {
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

/* ═══════════════════════════════════════════════════════
   VISTA 1: CONFIGURACIÓN
   ═══════════════════════════════════════════════════════ */
#vista-config {
  justify-content: center;
  padding: 2rem 1rem;
}

.config-container {
  width: 100%;
  max-width: 520px;
  padding: 3rem 2.5rem;
  text-align: center;
}

.logo-area {
  margin-bottom: 2.5rem;
}

.logo-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  animation: pulse-glow 3s infinite ease-in-out;
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.3)); }
  50% { filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.5)); }
}

h1 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Form */
.config-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.form-group {
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.select-wrapper {
  position: relative;
}

.select-wrapper select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 1rem 3rem 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.select-wrapper select:hover {
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.07);
}

.select-wrapper select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.select-wrapper select option {
  background: #1a1a2e;
  color: var(--text-primary);
}

.select-arrow {
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Info Cards */
.info-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.info-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 0.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.info-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.info-icon {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.info-data {
  display: flex;
  flex-direction: column;
}

.info-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.info-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 90%;
  max-width: 400px;
  padding: 2.5rem 2rem;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: var(--text-primary);
}

.modal-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.modal-actions button {
  padding: 0.8rem 1.2rem;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
}

/* Buttons */
.btn-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.1);
  color: var(--accent-red);
  border: 1px solid rgba(248, 113, 113, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel:hover {
  background: rgba(248, 113, 113, 0.2);
  transform: scale(1.05);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 2rem;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3), 0 4px 15px rgba(124, 58, 237, 0.2);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--border-active);
}

/* ═══════════════════════════════════════════════════════
   VISTA 2: EXAMEN
   ═══════════════════════════════════════════════════════ */
#vista-examen {
  padding: 0;
  min-height: 100vh;
}

.exam-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-radius: 0;
  border-top: none;
  border-left: none;
  border-right: none;
  width: 100%;
  background: rgba(6, 6, 15, 0.85);
  backdrop-filter: blur(30px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.exam-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 0.3rem 0.8rem;
  background: var(--gradient-primary);
  border-radius: 20px;
  color: white;
}

.exam-progress-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.timer-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
}

.timer-icon {
  color: var(--accent-cyan);
}

.timer-display {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.timer-container.warning {
  border-color: var(--accent-amber);
  background: rgba(251, 191, 36, 0.08);
}

.timer-container.warning .timer-display {
  color: var(--accent-amber);
}

.timer-container.warning .timer-icon {
  color: var(--accent-amber);
  animation: pulse-timer 1s infinite;
}

.timer-container.danger {
  border-color: var(--accent-red);
  background: rgba(248, 113, 113, 0.1);
  animation: shake 0.5s ease-in-out;
}

.timer-container.danger .timer-display {
  color: var(--accent-red);
}

.timer-container.danger .timer-icon {
  color: var(--accent-red);
  animation: pulse-timer 0.5s infinite;
}

@keyframes pulse-timer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* Progress Bar */
.progress-bar-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 60px;
  z-index: 9;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 0 2px 2px 0;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  width: 0%;
}

.progress-bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan);
}

/* Question Area */
.question-area {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  width: 100%;
}

.question-card {
  width: 100%;
  max-width: 760px;
  padding: 2.5rem;
  position: relative;
  animation: slideIn 0.35s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.question-number {
  position: absolute;
  top: -18px;
  left: 24px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 1rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  color: white;
  letter-spacing: 0.05em;
}

.question-text {
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 2rem;
  white-space: pre-line;
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.option-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-active);
  transform: translateX(4px);
}

.option-item.correct-revealed {
  border-color: var(--accent-green);
  background: rgba(52, 211, 153, 0.1);
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.15);
}

.option-item.correct-revealed .option-letter {
  color: var(--accent-green);
  background: rgba(52, 211, 153, 0.2);
}

.option-item.correct-revealed .option-text {
  color: var(--accent-green);
  font-weight: 600;
}

.reveal-container {
  margin-top: 1.5rem;
  text-align: right;
}

.btn-sm {
  padding: 0.5rem 0.8rem;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-sm:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--border-active);
}

.option-item.selected {
  background: rgba(0, 212, 255, 0.08);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.08);
}

.option-item.selected .option-radio {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan);
}

.option-item.selected .option-radio::after {
  opacity: 1;
  transform: scale(1);
}

.option-radio {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  margin-top: 2px;
  transition: all 0.25s ease;
  position: relative;
}

.option-radio::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  transition: all 0.25s ease;
}

.option-letter {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  text-transform: uppercase;
}

.option-item.selected .option-letter {
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.15);
}

.option-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  flex: 1;
  padding-top: 2px;
}

.option-item.selected .option-text {
  color: var(--text-primary);
}

/* Nav */
.exam-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem 1.5rem;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  gap: 1rem;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  white-space: nowrap;
}

.btn-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-dots {
  display: flex;
  gap: 4px;
  overflow: hidden;
  max-width: 200px;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.nav-dot.answered {
  background: var(--accent-cyan);
  opacity: 0.5;
}

.nav-dot.current {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  opacity: 1;
  width: 20px;
  border-radius: 4px;
}

/* Finalizar button style */
.btn-finalizar {
  background: var(--gradient-warm) !important;
}

.btn-finalizar:hover {
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3), 0 4px 15px rgba(244, 114, 182, 0.2) !important;
}

/* ═══════════════════════════════════════════════════════
   VISTA 3: RESULTADOS
   ═══════════════════════════════════════════════════════ */
#vista-resultados {
  padding: 2rem 1rem;
  align-items: center;
}

.results-container {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.results-header {
  padding: 3rem 2rem;
  text-align: center;
}

.results-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.results-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.results-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Score Ring */
.score-ring-container {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 2rem auto;
}

.score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring-bg {
  stroke: rgba(255, 255, 255, 0.06);
}

.score-ring-fill {
  stroke: url(#grad1);
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 800;
}

/* Stats Row */
.stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 1.6rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border-subtle);
}

/* Passed / Failed colors */
.results-header.passed { --result-color: var(--accent-green); }
.results-header.passed h2 { color: var(--accent-green); }
.results-header.passed .score-ring-fill { stroke: var(--accent-green); }
.results-header.passed .score-value { color: var(--accent-green); }
.results-header.passed .stat-number:first-of-type { color: var(--accent-green); }

.results-header.failed { --result-color: var(--accent-red); }
.results-header.failed h2 { color: var(--accent-red); }
.results-header.failed .score-ring-fill { stroke: var(--accent-red); }
.results-header.failed .score-value { color: var(--accent-red); }

/* Audit Section */
.audit-section {
  display: none;
}

.audit-section.visible {
  display: block;
}

.audit-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  padding: 0 0.5rem;
}

.audit-title svg {
  color: var(--accent-amber);
}

.audit-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.audit-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  transition: all 0.3s ease;
}

.audit-item-header {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.audit-item-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.audit-q-number {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  background: rgba(248, 113, 113, 0.15);
  color: var(--accent-red);
  border-radius: 6px;
  margin-top: 2px;
}

.audit-q-text {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.audit-toggle {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  margin-top: 2px;
}

.audit-item.open .audit-toggle {
  transform: rotate(180deg);
}

.audit-item-body {
  display: none;
  padding: 0 1.2rem 1.2rem;
  border-top: 1px solid var(--border-subtle);
}

.audit-item.open .audit-item-body {
  display: block;
}

.audit-answer {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.audit-answer + .audit-answer {
  border-top: 1px solid rgba(255,255,255,0.04);
}

.audit-answer-label {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.audit-answer-label.user {
  background: rgba(248, 113, 113, 0.15);
  color: var(--accent-red);
}

.audit-answer-label.correct {
  background: rgba(52, 211, 153, 0.15);
  color: var(--accent-green);
}

.audit-answer-text {
  color: var(--text-secondary);
}

/* ─── Time Elapsed Row ─── */
.time-elapsed-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
  padding: 0.9rem 1.2rem;
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: var(--radius-md);
  animation: fadeSlideUp 0.8s ease-out 0.5s both;
}

.time-elapsed-row svg {
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.time-elapsed-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.time-elapsed-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-cyan);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

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

/* ─── Share Actions Bar ─── */
.share-actions-bar {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: fadeSlideUp 0.8s ease-out 0.8s both;
}

.share-actions-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.share-actions-title svg {
  color: var(--accent-violet);
}

/* Download Button */
.share-btn--download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.9rem 1.2rem;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.share-btn--download::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.share-btn--download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.25), 0 4px 15px rgba(124, 58, 237, 0.2);
}

.share-btn--download:hover::before {
  opacity: 1;
}

.share-btn--download:active {
  transform: translateY(0);
}

.share-btn--download.downloading span {
  opacity: 0;
}

.share-btn--download.downloading::after {
  content: 'Generando captura...';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Social Share Row */
.share-social-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.share-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.share-social-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

.share-social-btn:hover {
  transform: translateY(-3px);
  border-color: transparent;
}

/* WhatsApp */
.share-social-btn.whatsapp:hover {
  background: #25D366;
  color: white;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

/* Twitter / X */
.share-social-btn.twitter:hover {
  background: #1a1a2e;
  color: white;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* LinkedIn */
.share-social-btn.linkedin:hover {
  background: #0A66C2;
  color: white;
  box-shadow: 0 6px 20px rgba(10, 102, 194, 0.35);
}

/* Copy Link */
.share-social-btn.copy-link:hover {
  background: var(--accent-violet);
  color: white;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

/* Native Share */
.share-social-btn.native-share:hover {
  background: var(--gradient-warm);
  color: white;
  box-shadow: 0 6px 20px rgba(244, 114, 182, 0.25);
}

/* Copied tooltip */
.share-social-btn.copied::after {
  content: '¡Copiado!';
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-green);
  background: var(--bg-surface);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(52, 211, 153, 0.3);
  white-space: nowrap;
  animation: tooltipPop 0.3s ease-out;
  pointer-events: none;
}

@keyframes tooltipPop {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Toast notification */
.share-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(13, 13, 26, 0.95);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
  color: var(--text-primary);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  animation: toastIn 0.4s ease-out forwards, toastOut 0.4s ease-in 2.5s forwards;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.share-toast svg {
  color: var(--accent-green);
  flex-shrink: 0;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* Reiniciar Button */
.btn-reiniciar {
  width: 100%;
  padding: 1.1rem;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  .config-container {
    padding: 2rem 1.5rem;
  }

  .info-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .info-value {
    font-size: 1.1rem;
  }

  .question-card {
    padding: 2rem 1.5rem;
  }

  .question-text {
    font-size: 1rem;
  }

  .exam-nav {
    padding: 1rem;
  }

  .nav-dots {
    display: none;
  }

  .btn-nav {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
  }

  .results-header {
    padding: 2rem 1.5rem;
  }

  .stats-row {
    gap: 1rem;
  }

  .stat-number {
    font-size: 1.3rem;
  }

  .exam-header {
    padding: 0.8rem 1rem;
  }

  .exam-badge {
    display: none;
  }

  .share-social-btn {
    width: 42px;
    height: 42px;
  }

  .time-elapsed-row {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  .config-container {
    padding: 1.5rem 1.2rem;
  }

  .info-cards {
    grid-template-columns: 1fr;
  }

  .info-card {
    flex-direction: row;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    text-align: left;
  }

  .info-data {
    flex-direction: row;
    align-items: baseline;
    gap: 0.5rem;
  }

  .question-card {
    padding: 1.5rem 1rem;
    border-radius: var(--radius-md);
  }

  .option-item {
    padding: 0.8rem 1rem;
  }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ─── Blocked state (time expired) ─── */
.exam-blocked .option-item {
  pointer-events: none;
  opacity: 0.5;
}

.exam-blocked .btn-nav {
  pointer-events: none;
  opacity: 0.3;
}

.time-expired-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem;
  background: rgba(248, 113, 113, 0.95);
  color: white;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  backdrop-filter: blur(10px);
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}
