/* Variables globales */
:root {
  --bg: #080c10;
  --surface: #0f1318;
  --surface2: #161c24;
  --border: rgba(255,255,255,0.07);
  --accent: #00e5a0;
  --text: #e8edf2;
  --text2: #8892a0;
  --text3: #4a5568;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Pantallas */
.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* Header */
header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
}

.logo span {
  color: var(--accent);
}

/* Pantalla 1 */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
}

h1 em {
  font-style: normal;
  color: var(--accent);
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text2);
  margin-bottom: 2rem;
}

.select-group {
  margin-bottom: 1.5rem;
  text-align: left;
  width: 100%;
  max-width: 500px;
}

.select-label {
  display: block;
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: .75rem;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.opt-btn {
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.opt-btn:hover {
  border-color: rgba(0,229,160,.4);
  color: var(--text);
}

.opt-btn.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0,229,160,.08);
}

.start-btn {
  width: 100%;
  max-width: 500px;
  padding: 1rem;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: .5rem;
}

.start-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* Badge del header */
.badge {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(0,229,160,.3);
  color: var(--accent);
}

/* Layout de entrevista */
.interview-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  flex: 1;
  min-height: calc(100vh - 65px);
}

/* Sidebar */
.sidebar {
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-section {}

.sidebar-title {
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: .5rem;
}

.score-big {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.score-label {
  font-size: 12px;
  color: var(--text3);
  margin-top: .25rem;
}

.score-bar-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: .75rem;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width .6s ease;
}

.prog-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text3);
  padding: 5px 6px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.prog-item.current {
  background: var(--surface2);
  color: var(--text);
}

.prog-item.done { color: var(--accent); }

.prog-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}

/* Área principal */
.main-area {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
}

.question-num {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: .75rem;
}

.question-text {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.5;
}

.answer-area {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.answer-label {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
}

textarea {
  width: 100%;
  min-height: 150px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  color: var(--text);
  font-size: 15px;
  font-family: 'Segoe UI', sans-serif;
  line-height: 1.7;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: rgba(0,229,160,.5);
}

.loading-state {
  display: none;
  align-items: center;
  gap: .75rem;
  color: var(--text2);
  font-size: 14px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.feedback-card {
  background: var(--surface2);
  border: 1px solid rgba(0,229,160,.15);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  display: none;
}

.feedback-title {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .75rem;
}

.feedback-text {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.7;
}

.score-chip {
  display: inline-block;
  margin-top: .75rem;
  background: rgba(0,229,160,.1);
  border: 1px solid rgba(0,229,160,.3);
  color: var(--accent);
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 20px;
}

.results-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.results-inner {
  max-width: 680px;
  width: 100%;
}

.results-header {
  text-align: center;
  margin-bottom: 2rem;
}

.results-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: .5rem;
}

.results-header p {
  color: var(--text2);
}

.score-final-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.score-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.score-final-num {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.score-final-den {
  font-size: 12px;
  color: var(--text3);
}

.score-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: .5rem;
}

.score-info p {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.breakdown-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}

.breakdown-label {
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: .5rem;
}

.breakdown-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.breakdown-desc {
  font-size: 12px;
  color: var(--text2);
  margin-top: .25rem;
}

.feedback-final {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.feedback-final-title {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.feedback-item {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  padding: .5rem .75rem;
  border-left: 2px solid rgba(0,229,160,.3);
  background: var(--surface2);
  border-radius: 0 6px 6px 0;
  margin-bottom: .5rem;
}


.submit-btn {
  padding: .75rem 2rem;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  width: auto;
}

.submit-btn:hover {
  background: #00ffb3;
  transform: translateY(-1px);
}

.submit-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none;
}

.results-inner .start-btn {
  display: block;
  margin: 0 auto;
  max-width: 400px;
}

.mic-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mic-btn {
  padding: .75rem 1.5rem;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.mic-btn:hover {
  background: rgba(0,229,160,.1);
}

.mic-btn.recording {
  background: rgba(255,50,50,.15);
  border-color: #ff3232;
  color: #ff3232;
  animation: pulse 1s infinite;
}

.mic-status {
  font-size: 12px;
  color: var(--text3);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}


/* ── CÁMARA Y ANÁLISIS FACIAL ── */
.cam-section {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: .5rem;
}

.cam-wrap {
  position: relative;
  width: 200px;
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #000;
}

#camVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

#camCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: scaleX(-1);
}

.cam-overlay {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
}

.emotion-badge {
  background: rgba(0,0,0,.7);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-align: center;
  letter-spacing: .05em;
}

.cam-stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  justify-content: center;
}

.cam-stat {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.cam-stat-label {
  font-size: 11px;
  color: var(--text3);
  width: 90px;
  flex-shrink: 0;
  letter-spacing: .05em;
}

.cam-bar-track {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.cam-bar-fill {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  transition: width .5s ease;
}

.cam-stat-val {
  font-size: 11px;
  color: var(--text2);
  width: 35px;
  text-align: right;
  font-family: var(--mono, monospace);
}