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

:root {
  --cyan:    #00f5ff;
  --violet:  #7c3aed;
  --indigo:  #4f46e5;
  --dark:    #07080f;
  --surface: rgba(12, 16, 30, 0.75);
  --border:  rgba(0, 245, 255, 0.12);
  --text:    #e2e8f0;
  --muted:   #64748b;
  --success: #10b981;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--dark);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
}

/* ─── BACKGROUND ORBS ────────────────────────────────────── */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
.orb1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(79,70,229,0.25) 0%, transparent 70%);
  top: -150px; left: -100px;
  animation: drift 12s ease-in-out infinite alternate;
}
.orb2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,245,255,0.12) 0%, transparent 70%);
  bottom: -100px; right: -80px;
  animation: drift 16s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(30px, 20px); }
}

/* ─── PAGES ──────────────────────────────────────────────── */
.page {
  display: none;
  position: fixed;
  inset: 0;
  justify-content: center;
  align-items: center;
  z-index: 1;
}
.page.active { display: flex; }

/* ─── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 44px;
  position: relative;
  z-index: 2;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.04) inset;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.setup-card  { width: 520px; text-align: center; }
.check-card  { width: 480px; text-align: center; }

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

/* ─── LOGO ───────────────────────────────────────────────── */
.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}
.logo-row.compact { justify-content: flex-start; margin-bottom: 0; }
.emma-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  flex-shrink: 0;
}
.emma-dot.small { width: 7px; height: 7px; }
.logo-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.3px;
}
.logo-text.small { font-size: 0.95rem; }
.logo-thin { font-weight: 400; color: var(--muted); }

/* ─── TYPOGRAPHY ─────────────────────────────────────────── */
.headline {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}
.headline.small { font-size: 2rem; }
.sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
  line-height: 1.7;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin: 16px 0 10px;
}
.card-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}
.step-badge {
  display: inline-block;
  background: rgba(0,245,255,0.1);
  border: 1px solid rgba(0,245,255,0.25);
  border-radius: 100px;
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 4px 14px;
  text-transform: uppercase;
}

/* ─── UPLOAD ZONE ────────────────────────────────────────── */
.upload-zone {
  border: 1.5px dashed rgba(0,245,255,0.3);
  border-radius: 16px;
  padding: 32px 24px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  background: rgba(0,245,255,0.02);
  text-align: center;
}
.upload-zone:hover {
  border-color: var(--cyan);
  background: rgba(0,245,255,0.05);
  transform: translateY(-1px);
}
.upload-icon {
  color: var(--cyan);
  margin-bottom: 10px;
  opacity: 0.8;
}
.upload-label {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
  font-size: 0.95rem;
}
.upload-hint { font-size: 0.8rem; color: var(--muted); }

.file-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,245,255,0.1);
  border: 1px solid rgba(0,245,255,0.3);
  border-radius: 100px;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 5px 14px;
  margin-top: 12px;
}

/* ─── ROLE INPUT ─────────────────────────────────────────── */
.field-wrap { text-align: left; margin-bottom: 20px; position: relative; }
.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 8px;
}
.input-combo {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
}
.role-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.role-input:focus {
  border-color: rgba(0,245,255,0.5);
  box-shadow: 0 0 0 3px rgba(0,245,255,0.08);
}
.role-input::placeholder { color: #475569; }

.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #0f172a;
  border: 1px solid rgba(0,245,255,0.2);
  border-radius: 12px;
  overflow: hidden;
  z-index: 50;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}
.role-item {
  padding: 11px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  transition: background 0.15s;
}
.role-item:hover { background: rgba(0,245,255,0.08); color: var(--cyan); }

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(79,70,229,0.4);
  letter-spacing: 0.2px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(79,70,229,0.55);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 28px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s;
}
.btn-ghost:hover {
  border-color: rgba(0,245,255,0.4);
  color: var(--cyan);
  background: rgba(0,245,255,0.04);
}

.footer-note { margin-top: 16px; font-size: 0.78rem; color: #334155; }

/* ─── SCREEN SHARE PAGE ──────────────────────────────────── */
.check-visual { margin: 24px 0; }
.shield-ring {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: rgba(0,245,255,0.06);
  border: 1px solid rgba(0,245,255,0.2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  animation: pulse-ring 2.5s ease-in-out infinite;
}
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,245,255,0.2); }
  50%       { box-shadow: 0 0 0 12px rgba(0,245,255,0); }
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 20px;
  font-size: 0.88rem;
  color: var(--muted);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.waiting  { background: #475569; }
.status-dot.active   { background: var(--success); box-shadow: 0 0 8px var(--success); }

/* ─── HARDWARE PAGE ──────────────────────────────────────── */
.hw-checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0 28px;
  text-align: left;
}
.hw-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(16,185,129,0.05);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 12px;
  padding: 14px 18px;
}
.hw-check {
  width: 28px; height: 28px;
  background: var(--success);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.hw-label  { font-weight: 600; font-size: 0.9rem; color: #fff; }
.hw-detail { font-size: 0.8rem; color: var(--muted); }

/* ─── INTERVIEW LAYOUT ───────────────────────────────────── */
.interview-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: var(--dark);
  overflow: hidden;
}

/* Header */
.interview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(7,8,15,0.8);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  z-index: 10;
}
.timer-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}
.timer-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.stage-badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--cyan);
  background: rgba(0,245,255,0.08);
  border: 1px solid rgba(0,245,255,0.2);
  border-radius: 100px;
  padding: 5px 14px;
}

/* Body */
.interview-body {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr 260px;
  gap: 16px;
  padding: 20px 24px;
  overflow: hidden;
}

/* Panels */
.panel {
  background: rgba(12,16,30,0.6);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 16px;
}

/* Emma panel */
.emma-panel { align-items: center; text-align: center; }
.avatar-wrap {
  position: relative;
  width: 110px; height: 110px;
  margin: 0 auto 12px;
}
.avatar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(124,58,237,0.5);
  animation: spin-ring 8s linear infinite;
}
@keyframes spin-ring { to { transform: rotate(360deg); } }
.avatar-face {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e1b4b, #4c1d95);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border: 2px solid rgba(124,58,237,0.6);
}
.speaking-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.speaking-ring.active {
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(0,245,255,0.3);
  animation: speaking-pulse 1s ease-in-out infinite;
}
@keyframes speaking-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(0,245,255,0.2); }
  50%       { box-shadow: 0 0 28px rgba(0,245,255,0.5); }
}
.emma-status {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 8px;
}

/* Chat panel */
.chat-panel { gap: 0; }
.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-scroll::-webkit-scrollbar { width: 4px; }
.chat-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: msgIn 0.3s ease both;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-msg .sender {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chat-msg.emma .sender { color: var(--cyan); }
.chat-msg.user .sender { color: var(--violet); }
.chat-msg .bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.55;
  max-width: 100%;
}
.chat-msg.emma .bubble {
  background: rgba(0,245,255,0.06);
  border: 1px solid rgba(0,245,255,0.12);
  color: var(--text);
}
.chat-msg.user .bubble {
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.2);
  color: var(--text);
}

/* User / webcam panel */
.user-panel { align-items: center; }
.webcam-frame {
  position: relative;
  width: 100%;
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0f;
  border: 1px solid rgba(255,255,255,0.06);
}
#webcam {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.live-badge {
  position: absolute;
  top: 10px; left: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #fff;
  background: rgba(239,68,68,0.85);
  border-radius: 6px;
  padding: 3px 10px;
}
.mic-status {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}
.mic-status.on { color: var(--success); }

/* Footer */
.interview-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 32px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(7,8,15,0.8);
  flex-shrink: 0;
}
.footer-hint {
  font-size: 0.82rem;
  color: var(--muted);
}
.btn-speak {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--indigo), var(--violet));
  border: none;
  border-radius: 100px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(79,70,229,0.4);
  animation: pulse-btn 2s ease-in-out infinite;
}
@keyframes pulse-btn {
  0%,100% { box-shadow: 0 4px 20px rgba(79,70,229,0.4); }
  50%     { box-shadow: 0 4px 32px rgba(79,70,229,0.7); }
}
.btn-speak:hover { transform: scale(1.03); }
.btn-speak.listening {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  animation: none;
  box-shadow: 0 4px 20px rgba(220,38,38,0.5);
}
.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.4);
  border-radius: 100px;
  color: var(--success);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-submit:hover { background: rgba(16,185,129,0.18); }

/* ─── END PAGE ───────────────────────────────────────────── */
.end-card { padding-top: 56px; padding-bottom: 56px; }
.end-icon { font-size: 3rem; margin-bottom: 16px; }
.end-stats {
  display: flex;
  gap: 16px;
  margin: 28px 0;
  justify-content: center;
}
.stat-box {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 18px;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--cyan);
}
.stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

/* ─── UTILITY ────────────────────────────────────────────── */
.hidden { display: none !important; }
