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

:root {
  --color-background: #020617;
  --color-card: #0E1223;
  --color-card-hover: #131834;
  --color-foreground: #F8FAFC;
  --color-muted: #1A1E2F;
  --color-muted-2: #171B2C;
  --color-muted-foreground: #94A3B8;
  --color-border: #263042;
  --color-border-strong: #334155;
  --color-primary: #6366F1;
  --color-primary-hover: #7B7FF5;
  --color-on-primary: #FFFFFF;
  --color-accent: #22C55E;
  --color-accent-soft: rgba(34, 197, 94, 0.12);
  --color-warning: #F59E0B;
  --color-warning-soft: rgba(245, 158, 11, 0.12);
  --color-destructive: #EF4444;
  --color-destructive-soft: rgba(239, 68, 68, 0.12);
  --color-ring: #818CF8;

  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.4), 0 8px 24px -12px rgba(0,0,0,0.5);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
*:focus-visible { outline: 2px solid var(--color-ring); outline-offset: 2px; }

html { color-scheme: dark; }

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-background);
  background-image: radial-gradient(circle at 15% -10%, rgba(99,102,241,0.10), transparent 40%);
  color: var(--color-foreground);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 920px; margin: 0 auto; padding: 40px 24px 100px; }

.topbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
}
.topbar .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--color-primary), #a78bfa);
  display: grid; place-items: center; color: #fff; font-size: 17px; flex-shrink: 0;
}
.topbar .brand { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }

h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.subtitle { color: var(--color-muted-foreground); margin: 0 0 28px; font-size: 14.5px; line-height: 1.6; max-width: 560px; }

.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px;
  margin-bottom: 20px;
}

label { display: block; font-size: 13px; font-weight: 600; color: var(--color-muted-foreground); margin: 16px 0 7px; }
label:first-of-type { margin-top: 0; }
label .required { color: var(--color-destructive); margin-left: 2px; }

input[type=text], input[type=password], input[type=email], textarea {
  width: 100%;
  background: var(--color-muted-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-foreground);
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 150ms var(--ease), background 150ms var(--ease);
}
input[type=text]:hover, input[type=password]:hover, input[type=email]:hover, textarea:hover { border-color: var(--color-border-strong); }
input[type=text]:focus, input[type=password]:focus, input[type=email]:focus, textarea:focus {
  outline: none; border-color: var(--color-primary);
  background: var(--color-card);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
}
textarea { min-height: 150px; line-height: 1.55; }

/* buttons */
button {
  font-family: inherit;
  background: var(--color-primary);
  color: var(--color-on-primary);
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background 150ms var(--ease), transform 100ms var(--ease), box-shadow 150ms var(--ease);
}
button:hover:not(:disabled) { background: var(--color-primary-hover); }
button:active:not(:disabled) { transform: scale(0.97); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary { background: var(--color-muted); border: 1px solid var(--color-border-strong); color: var(--color-foreground); }
button.secondary:hover:not(:disabled) { background: var(--color-card-hover); border-color: var(--color-muted-foreground); }
button.ghost { background: transparent; border: 1px solid var(--color-border-strong); color: var(--color-foreground); }
button.ghost:hover:not(:disabled) { background: var(--color-muted); }
button.icon-btn { padding: 9px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.result-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
  border: 1px solid rgba(34,197,94,0.35);
  font-size: 14px;
}
.result-box .link-text { color: var(--color-accent); font-weight: 600; word-break: break-all; margin-bottom: 12px; }

/* upload dropzone */
.dropzone {
  border: 1.5px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-muted-2);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms var(--ease), background 150ms var(--ease);
  color: var(--color-muted-foreground);
  font-size: 13px;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--color-primary); background: var(--color-card-hover); color: var(--color-foreground); }
.dropzone .ph { font-size: 22px; display: block; margin-bottom: 6px; color: var(--color-primary); }
.dropzone-filled {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-muted-2);
  padding: 10px 14px;
  font-size: 13px;
}
.dropzone-filled .file-info { display: flex; align-items: center; gap: 8px; color: var(--color-foreground); overflow: hidden; }
.dropzone-filled .file-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone-filled .ph { color: var(--color-accent); font-size: 17px; }
.field-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--color-muted-foreground); font-size: 12px; }
.field-divider::before, .field-divider::after { content: ''; flex: 1; height: 1px; background: var(--color-border); }

/* table */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--color-border); vertical-align: top; }
th { color: var(--color-muted-foreground); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--color-muted-2); }
a { color: var(--color-primary); text-decoration: none; font-weight: 500; }
a:hover { color: var(--color-primary-hover); text-decoration: underline; }
.back-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; margin-bottom: 20px; color: var(--color-muted-foreground); }
.back-link:hover { color: var(--color-foreground); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: capitalize;
}
.badge .ph { font-size: 12px; }
.badge.pending { background: var(--color-warning-soft); color: var(--color-warning); }
.badge.in_progress { background: rgba(99,102,241,0.14); color: #a5b4fc; }
.badge.completed { background: var(--color-accent-soft); color: var(--color-accent); }
.badge.cancelled { background: var(--color-muted); color: var(--color-muted-foreground); }
.badge.paused, .badge.pause_requested, .badge.resume_requested { background: var(--color-warning-soft); color: var(--color-warning); }
.badge.stale { background: var(--color-destructive-soft); color: var(--color-destructive); margin-left: 6px; }

.match-pill { font-weight: 800; font-variant-numeric: tabular-nums; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--color-muted-foreground); }
.empty-state .ph { font-size: 30px; display: block; margin-bottom: 10px; opacity: 0.6; }

/* interview call screen */
.call-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: var(--color-background);
  background-image: radial-gradient(circle at 50% 0%, rgba(99,102,241,0.14), transparent 55%);
}
.monitor-tag {
  position: fixed; top: 18px; left: 18px;
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--color-muted-foreground);
  background: var(--color-card); border: 1px solid var(--color-border);
  padding: 6px 12px; border-radius: 999px;
}
.monitor-tag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-destructive); animation: pulse-dot 1.6s infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.self-view {
  position: fixed; top: 18px; right: 18px; width: 140px; border-radius: 12px;
  border: 1px solid var(--color-border-strong); transform: scaleX(-1);
  box-shadow: var(--shadow-card);
}

.orb {
  width: 130px; height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--color-primary), #2c3a7a 70%);
  margin-bottom: 30px;
  box-shadow: 0 0 0 0 rgba(99,102,241,.5);
  transition: box-shadow 300ms var(--ease), background 300ms var(--ease);
}
.orb.listening { box-shadow: 0 0 0 20px rgba(99,102,241,.12); }
.orb.speaking { box-shadow: 0 0 0 20px rgba(34,214,176,.14); background: radial-gradient(circle at 35% 30%, var(--color-accent), #206655 70%); }

.status-text { color: var(--color-muted-foreground); font-size: 14px; margin-bottom: 6px; min-height: 20px; }
.progress-text { color: var(--color-muted-foreground); font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; margin-bottom: 24px; }
.live-transcript { max-width: 560px; min-height: 56px; font-size: 16px; line-height: 1.5; margin-bottom: 24px; color: var(--color-foreground); }
.question-text { max-width: 560px; font-size: 20px; font-weight: 700; margin-bottom: 22px; line-height: 1.4; letter-spacing: -0.01em; }

/* gauge */
.gauge-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.gauge {
  --size: 148px; --thickness: 13px;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  background: conic-gradient(var(--gauge-color, var(--color-accent)) calc(var(--value, 0) * 1%), var(--color-muted) 0);
  display: grid; place-items: center; position: relative; flex-shrink: 0;
}
.gauge::before { content: ''; position: absolute; inset: var(--thickness); border-radius: 50%; background: var(--color-card); }
.gauge-value { position: relative; z-index: 1; font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.gauge-value small { font-size: 15px; font-weight: 600; color: var(--color-muted-foreground); }
.gauge-label { color: var(--color-muted-foreground); font-size: 12px; font-weight: 600; text-align: center; margin-top: 8px; text-transform: uppercase; letter-spacing: .04em; }
.gauge.sm { --size: 84px; --thickness: 8px; }
.gauge.sm .gauge-value { font-size: 20px; }

.pill-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--color-muted-2); border: 1px solid var(--color-border-strong); border-radius: 999px; padding: 6px 13px; font-size: 13px; }
.pill .ph { font-size: 13px; }
.pill.gap { border-color: rgba(239,68,68,0.35); background: var(--color-destructive-soft); color: #fca5a5; }
.pill.strength { border-color: rgba(34,197,94,0.35); background: var(--color-accent-soft); color: #86efac; }

.recommendation-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 13px; padding: 5px 12px; border-radius: 999px;
}
.recommendation-tag.strong { background: var(--color-accent-soft); color: var(--color-accent); }
.recommendation-tag.possible { background: var(--color-warning-soft); color: var(--color-warning); }
.recommendation-tag.not { background: var(--color-destructive-soft); color: var(--color-destructive); }

.risk-tag { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.risk-tag.low { color: var(--color-accent); }
.risk-tag.medium { color: var(--color-warning); }
.risk-tag.high { color: var(--color-destructive); }

.stat-line { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--color-border); font-size: 13.5px; }
.stat-line:last-child { border-bottom: none; }
.stat-line span:first-child { color: var(--color-muted-foreground); }
.stat-line span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }

.transcript-turn { padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.transcript-turn:last-child { border-bottom: none; }
.transcript-turn .who { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--color-muted-foreground); margin-bottom: 4px; }
.transcript-turn.ai .who { color: #a5b4fc; }
.transcript-turn.candidate .who { color: var(--color-accent); }

@media (max-width: 600px) {
  .wrap { padding: 24px 16px 80px; }
  h1 { font-size: 22px; }
  .gauge-wrap { justify-content: center; }
}
