/* ═══════════════════════════════════════════════════════════════════════════════
   DecisionLab AI - Design System v3 (Dark Premium B2B)
   Inspirado en: BeatStory, Vercel Dark, Linear Dark
   ═══════════════════════════════════════════════════════════════════════════════ */

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

:root {
  /* Paleta oscura premium */
  --color-bg-primary: #0A0E1A;
  --color-bg-secondary: #111827;
  --color-bg-tertiary: #1F2937;
  --color-bg-elevated: #1A2030;
  --color-bg-overlay: rgba(15, 23, 42, 0.8);
  
  /* Naranja signature con gradiente */
  --color-accent: #FF8A1F;
  --color-accent-hover: #FF7A0A;
  --color-accent-light: #FFA94D;
  --color-accent-glow: rgba(255, 138, 31, 0.4);
  --gradient-accent: linear-gradient(135deg, #FF8A1F 0%, #FF6B0A 100%);
  --gradient-accent-hover: linear-gradient(135deg, #FFA94D 0%, #FF8A1F 100%);
  
  /* Estados semánticos en dark */
  --color-success: #10B981;
  --color-success-bg: rgba(16, 185, 129, 0.1);
  --color-warning: #F59E0B;
  --color-warning-bg: rgba(245, 158, 11, 0.1);
  --color-danger: #EF4444;
  --color-danger-bg: rgba(239, 68, 68, 0.1);
  
  /* Texto */
  --color-text-primary: #F8FAFC;
  --color-text-secondary: #CBD5E1;
  --color-text-muted: #64748B;
  --color-text-inverse: #0A0E1A;
  
  /* Bordes */
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.16);
  --color-border-focus: var(--color-accent);
  
  /* Tipografía */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Espaciado */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* Sombras dark mode */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px var(--color-accent-glow);
  --shadow-glow-strong: 0 8px 32px rgba(255, 138, 31, 0.35);
  
  /* Transiciones */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Fondo con efecto sutil de gradiente radial */
  background-image: 
    radial-gradient(ellipse at 20% 0%, rgba(255, 138, 31, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(255, 138, 31, 0.04) 0%, transparent 50%);
  background-attachment: fixed;
}

/* ───────────────────────────────────────────────────────────────────────────────
   LAYOUT
   ─────────────────────────────────────────────────────────────────────────────── */

.app {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ───────────────────────────────────────────────────────────────────────────────
   HEADER
   ─────────────────────────────────────────────────────────────────────────────── */

.header {
  text-align: center;
  margin-bottom: var(--space-3xl);
  padding: var(--space-xl) 0;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.logo-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 12px var(--color-accent-glow));
}

.logo h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
}

.logo-accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.tagline {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
}

/* ───────────────────────────────────────────────────────────────────────────────
   VISTAS
   ─────────────────────────────────────────────────────────────────────────────── */

.view {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hidden {
  display: none !important;
}

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

/* ───────────────────────────────────────────────────────────────────────────────
   CARDS
   ─────────────────────────────────────────────────────────────────────────────── */

.card {
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

/* Borde superior con gradiente sutil */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  opacity: 0.4;
}

.card h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--color-text-primary);
}

.subtitle {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xl);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.hint {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 400;
  margin-top: 4px;
}

/* ───────────────────────────────────────────────────────────────────────────────
   FORMULARIOS
   ─────────────────────────────────────────────────────────────────────────────── */

.form-group {
  margin-bottom: var(--space-lg);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

label {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: 0.875rem;
  color: var(--color-text-primary);
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
  background-color: var(--color-bg-elevated);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--color-border-strong);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.6;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23CBD5E1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-md) center;
  padding-right: var(--space-2xl);
}

/* ───────────────────────────────────────────────────────────────────────────────
   BOTONES
   ─────────────────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
}

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

/* Botón primario con gradiente naranja y sombra glow */
.btn-primary {
  background: var(--gradient-accent);
  color: white;
  box-shadow: var(--shadow-glow);
  font-weight: 700;
}

.btn-primary:hover:not(:disabled) {
  background: var(--gradient-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-strong);
}

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

/* Efecto shine en hover */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s;
}

.btn-primary:hover:not(:disabled)::after {
  left: 100%;
}

.btn-secondary {
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--color-bg-elevated);
  border-color: var(--color-accent);
}

.btn-large {
  width: 100%;
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
  margin-top: var(--space-md);
}

/* ───────────────────────────────────────────────────────────────────────────────
   PROGRESS BAR
   ─────────────────────────────────────────────────────────────────────────────── */

.progress-bar {
  margin-bottom: var(--space-xl);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.progress-info span:first-child {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  letter-spacing: -0.01em;
}

.skill-badge {
  background: rgba(255, 138, 31, 0.12);
  color: var(--color-accent);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(255, 138, 31, 0.2);
}

.progress-track {
  height: 6px;
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
  box-shadow: 0 0 12px var(--color-accent-glow);
}

/* ───────────────────────────────────────────────────────────────────────────────
   SITUATION + CUSTOMER MESSAGE
   ─────────────────────────────────────────────────────────────────────────────── */

.situation-block {
  background-color: rgba(255, 138, 31, 0.06);
  border: 1px solid rgba(255, 138, 31, 0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
}

.situation-block h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
  font-weight: 700;
}

.situation-block p {
  color: var(--color-text-primary);
  line-height: 1.7;
  font-size: 0.9375rem;
}

.customer-message {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  align-items: flex-start;
}

.customer-avatar {
  width: 48px;
  height: 48px;
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.customer-bubble {
  background-color: var(--color-bg-elevated);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  border-top-left-radius: 4px;
  flex: 1;
  border: 1px solid var(--color-border);
}

.customer-bubble p {
  font-style: italic;
  color: var(--color-text-primary);
  line-height: 1.6;
  font-size: 0.9375rem;
}

.question-block {
  background-color: var(--color-warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
}

.question-block h3 {
  color: var(--color-warning);
  margin-bottom: 0;
  font-size: 1rem;
  font-weight: 600;
}

/* ───────────────────────────────────────────────────────────────────────────────
   VOICE CONTROLS
   ─────────────────────────────────────────────────────────────────────────────── */

.voice-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  align-items: center;
}

.voice-status {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin: 0;
}

/* ───────────────────────────────────────────────────────────────────────────────
   LOADING
   ─────────────────────────────────────────────────────────────────────────────── */

.loading-msg {
  text-align: center;
  margin-top: var(--space-md);
  color: var(--color-accent);
  font-size: 0.9375rem;
  font-weight: 500;
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* ───────────────────────────────────────────────────────────────────────────────
   SUMMARY
   ─────────────────────────────────────────────────────────────────────────────── */

.score-hero {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-xl);
  background: linear-gradient(135deg, rgba(255, 138, 31, 0.08) 0%, rgba(255, 138, 31, 0.02) 100%);
  border: 1px solid rgba(255, 138, 31, 0.15);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-xl);
}

.score-circle {
  width: 120px;
  height: 120px;
  background: var(--color-bg-secondary);
  border: 3px solid transparent;
  background-image: 
    linear-gradient(var(--color-bg-secondary), var(--color-bg-secondary)),
    var(--gradient-accent);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.score-circle span:first-child {
  font-size: 3rem;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.04em;
}

.score-max {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  margin-left: 4px;
  font-weight: 500;
}

.score-info h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
  color: var(--color-text-primary);
}

.score-info p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.summary-blocks {
  display: grid;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.summary-block {
  padding: var(--space-lg);
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
  border-left: 3px solid;
  border-top: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.summary-block h4 {
  font-size: 0.9375rem;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.summary-block p {
  color: var(--color-text-secondary);
  line-height: 1.7;
  font-size: 0.9375rem;
}

.summary-strengths {
  border-left-color: var(--color-success);
}

.summary-strengths h4 {
  color: var(--color-success);
}

.summary-gaps {
  border-left-color: var(--color-warning);
}

.summary-gaps h4 {
  color: var(--color-warning);
}

.summary-next {
  border-left-color: var(--color-accent);
}

.summary-next h4 {
  color: var(--color-accent);
}

/* ───────────────────────────────────────────────────────────────────────────────
   DETAIL BLOCK
   ─────────────────────────────────────────────────────────────────────────────── */

.detail-block {
  background-color: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  overflow: hidden;
}

.detail-block summary {
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  user-select: none;
  transition: var(--transition);
  color: var(--color-text-primary);
}

.detail-block summary:hover {
  background-color: var(--color-bg-elevated);
}

.detail-block[open] summary {
  border-bottom: 1px solid var(--color-border);
}

.question-detail {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.question-detail:last-child {
  border-bottom: none;
}

.question-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.question-detail-header strong {
  color: var(--color-text-primary);
  font-weight: 600;
  font-size: 0.9375rem;
}

.question-score {
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: -0.005em;
}

.score-high {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.score-mid {
  background-color: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.score-low {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Lista de mejoras con flechas naranjas */
.improvements-list {
  list-style: none;
  padding: 0;
  margin: var(--space-sm) 0;
}

.improvements-list li {
  padding: var(--space-md) 0;
  padding-left: var(--space-xl);
  position: relative;
  color: var(--color-text-secondary);
  line-height: 1.7;
  font-size: 0.9rem;
  border-bottom: 1px dashed var(--color-border);
}

.improvements-list li:last-child {
  border-bottom: none;
}

.improvements-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  top: var(--space-md);
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  font-size: 1.125rem;
}

/* ───────────────────────────────────────────────────────────────────────────────
   FOOTER
   ─────────────────────────────────────────────────────────────────────────────── */

.footer {
  text-align: center;
  padding: var(--space-2xl) 0 var(--space-md);
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  margin-top: auto;
}

.footer strong {
  color: var(--color-text-secondary);
  font-weight: 600;
}

/* ───────────────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ─────────────────────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .app {
    padding: var(--space-md) var(--space-sm);
  }
  
  .card {
    padding: var(--space-lg);
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .logo h1 {
    font-size: 1.5rem;
  }
  
  .score-hero {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }
  
  .voice-controls {
    flex-direction: column;
    align-items: stretch;
  }
}