/* ═══════════════════════════════════════════════════════════════
   ConvoHR External Scorecard — Styles (FEAT-016)
   ═══════════════════════════════════════════════════════════════ */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --bg: #0f0f17;
  --bg-card: #1a1a2e;
  --bg-card-hover: #222240;
  --text: #e8e8f0;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --border: #2d2d44;
  --green: #22c55e;
  --green-dim: rgba(34,197,94,0.12);
  --amber: #f59e0b;
  --amber-dim: rgba(245,158,11,0.12);
  --red: #ef4444;
  --red-dim: rgba(239,68,68,0.12);
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

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

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

/* ── Layout ── */
.header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16162a 100%);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
}
.header-inner {
  max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { font-size: 20px; font-weight: 700; color: var(--primary-light); text-decoration: none; }
.logo span { color: var(--text-muted); font-weight: 400; font-size: 14px; margin-left: 8px; }

.container { max-width: 720px; margin: 0 auto; padding: 32px 24px 80px; }

.footer {
  text-align: center; padding: 24px;
  border-top: 1px solid var(--border); color: var(--text-dim); font-size: 12px;
}

/* ── State screens ── */
.state-screen {
  text-align: center; padding: 80px 24px;
}
.state-screen .icon { font-size: 64px; margin-bottom: 16px; display: block; }
.state-screen h2 { font-size: 24px; margin-bottom: 12px; }
.state-screen p { color: var(--text-muted); max-width: 460px; margin: 0 auto 16px; font-size: 15px; }
.state-screen a { color: var(--primary-light); }

/* ── Loading ── */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Countdown banner ── */
.countdown-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 24px; font-size: 14px;
}
.countdown-banner.ok { background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.2); color: var(--primary-light); }
.countdown-banner.warn { background: var(--amber-dim); border: 1px solid rgba(245,158,11,0.3); color: var(--amber); }
.countdown-banner.overdue { background: var(--red-dim); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }

/* ── Card ── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
}
.card-title {
  font-size: 16px; font-weight: 600; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.card-title .emoji { font-size: 18px; }

/* ── Interview info grid ── */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.info-item label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); margin-bottom: 2px; }
.info-item span { font-size: 14px; font-weight: 500; }

/* ── Questions panel ── */
.questions-toggle {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; width: 100%; background: none; border: none;
  color: var(--text); font: inherit; padding: 0;
}
.questions-toggle .chevron { transition: transform .2s; font-size: 14px; color: var(--text-dim); }
.questions-toggle.open .chevron { transform: rotate(180deg); }
.questions-list { margin-top: 12px; list-style: none; }
.questions-list li {
  padding: 8px 12px; background: rgba(99,102,241,0.06);
  border-radius: 8px; margin-bottom: 6px; font-size: 14px;
  border-left: 3px solid var(--primary);
}

/* ── Criteria rating ── */
.criterion { margin-bottom: 20px; }
.criterion-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.criterion-label { font-size: 14px; font-weight: 500; }
.criterion-score { font-size: 13px; color: var(--text-muted); min-width: 36px; text-align: right; }
.rating-bar { display: flex; gap: 4px; }
.rating-btn {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.rating-btn:hover { border-color: var(--primary); color: var(--primary-light); background: rgba(99,102,241,0.08); }
.rating-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.criterion-notes {
  margin-top: 8px; width: 100%; padding: 8px 12px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font: inherit; font-size: 13px;
  resize: vertical; min-height: 40px;
}
.criterion-notes::placeholder { color: var(--text-dim); }

/* ── Overall recommendation ── */
.rec-group { display: flex; gap: 8px; flex-wrap: wrap; }
.rec-btn {
  padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); cursor: pointer; transition: all .15s;
}
.rec-btn:hover { border-color: var(--primary); }
.rec-btn.active.strongYes { background: var(--green); border-color: var(--green); color: #fff; }
.rec-btn.active.yes { background: rgba(34,197,94,0.7); border-color: var(--green); color: #fff; }
.rec-btn.active.neutral { background: var(--amber); border-color: var(--amber); color: #000; }
.rec-btn.active.no { background: rgba(239,68,68,0.7); border-color: var(--red); color: #fff; }
.rec-btn.active.strongNo { background: var(--red); border-color: var(--red); color: #fff; }

/* ── Textarea / highlights ── */
.form-textarea {
  width: 100%; padding: 12px; min-height: 80px; resize: vertical;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font: inherit; font-size: 14px;
}
.form-textarea::placeholder { color: var(--text-dim); }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text-muted); }

/* ── Autosave indicator ── */
.autosave-indicator {
  position: fixed; bottom: 80px; right: 24px;
  padding: 8px 16px; border-radius: 20px; font-size: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-dim); opacity: 0; transition: opacity .3s;
  pointer-events: none; z-index: 50;
}
.autosave-indicator.visible { opacity: 1; }
.autosave-indicator.saving { color: var(--amber); border-color: rgba(245,158,11,0.3); }
.autosave-indicator.saved { color: var(--green); border-color: rgba(34,197,94,0.3); }

/* ── Submit bar ── */
.submit-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, transparent 0%, var(--bg) 30%);
  padding: 16px 24px 24px; z-index: 40;
}
.submit-bar-inner {
  max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.btn-submit {
  padding: 12px 32px; border-radius: 10px; font-size: 15px; font-weight: 600;
  border: none; cursor: pointer; transition: all .2s;
  background: var(--primary); color: #fff;
}
.btn-submit:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.overall-score-display { font-size: 14px; color: var(--text-muted); }
.overall-score-display strong { color: var(--text); font-size: 20px; }

/* ── Read-only submitted view ── */
.submitted-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500;
  background: var(--green-dim); color: var(--green); margin-bottom: 20px;
}

/* ── Notes callout ── */
.notes-callout {
  padding: 14px 16px; border-radius: var(--radius);
  background: rgba(99,102,241,0.06); border-left: 3px solid var(--primary);
  font-size: 14px; color: var(--text-muted); margin-bottom: 20px;
  white-space: pre-wrap;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .info-grid { grid-template-columns: 1fr; }
  .rating-btn { width: 32px; height: 32px; font-size: 12px; }
  .rec-group { flex-direction: column; }
  .submit-bar-inner { flex-direction: column; }
}
