/* ==========================================================================
   HR Sentiment Analyzer — shared UI (login + upload)
   Light theme matched to the HTML report: white surfaces, #F4F8FD page,
   navy headings (#0B2D5C) and blue accents (#2563EB / #1D4ED8).
   ========================================================================== */

:root {
  --page: #F4F8FD;
  --surface: #FFFFFF;
  --heading: #0B2D5C;
  --text: #14233F;
  --text-2: #5B6B82;
  --text-3: #8A97AC;
  --grid: #DCE9FB;
  --border: #DCE6F2;
  --border-strong: #B8C4D6;
  --accent: #2563EB;
  --accent-dark: #1D4ED8;
  --accent-soft: rgba(37, 99, 235, 0.07);
  --navy-grad: linear-gradient(135deg, #0B2D5C 0%, #1A4E8C 100%);
  --critical: #E0455F;
  --radius-card: 16px;
  --radius-ctl: 10px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 700px at 80% -15%, rgba(37, 99, 235, 0.06), transparent 60%),
    radial-gradient(900px 650px at -10% 115%, rgba(26, 78, 140, 0.05), transparent 60%),
    var(--page);
  background-attachment: fixed;
}

::selection { background: rgba(37, 99, 235, 0.18); }

/* --------------------------------------------------------------- layout */

.shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 64px;
  padding: 56px 40px;
}

body.has-topbar .shell { min-height: auto; align-items: flex-start; padding: 44px 40px 28px; }

/* --------------------------------------------------------------- topbar */

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 14.5px;
  letter-spacing: 0.01em;
  color: var(--heading);
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563EB, #1A4E8C);
  box-shadow: 0 5px 14px -4px rgba(37, 99, 235, 0.55);
  color: #fff;
  font-size: 13px;
}

.userchip {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13.5px;
  color: var(--text-2);
}

.userchip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0E9F6E;
  box-shadow: 0 0 0 3px rgba(14, 159, 110, 0.15);
  display: inline-block;
  margin-right: 7px;
}

.userchip a {
  color: var(--text-2);
  text-decoration: none;
  font-weight: 600;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: 0.15s ease;
}

.userchip a:hover { color: var(--heading); border-color: var(--border-strong); background: var(--page); }

/* ----------------------------------------------------------------- hero */

.hero { width: min(580px, 100%); }

.hero-panel {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 16 / 10.5;
  background: var(--navy-grad);
  box-shadow: 0 30px 60px -22px rgba(11, 45, 92, 0.45);
}

.hero-panel svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-caption {
  margin: 26px auto 0;
  max-width: 480px;
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.65;
}

.hero-caption strong { color: var(--heading); font-weight: 650; }

/* ----------------------------------------------------------------- card */

.card {
  width: min(460px, 100%);
  border-radius: var(--radius-card);
  padding: 38px 36px 32px;
  background: var(--surface);
  border: 1px solid #D3DFEF;
  box-shadow: 0 28px 60px -22px rgba(11, 45, 92, 0.3), 0 2px 12px rgba(11, 45, 92, 0.08);
}

.card-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--heading);
}

.card h1 {
  margin: 0 0 6px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.card .sub { margin: 0 0 26px; color: var(--text-2); font-size: 14.5px; }

.card form { display: flex; flex-direction: column; gap: 20px; }

.section-label {
  display: block;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* --------------------------------------------------------------- alerts */

.error {
  margin: 0 0 20px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--critical);
  background: rgba(224, 69, 95, 0.08);
  border: 1px solid rgba(224, 69, 95, 0.3);
}

/* -------------------------------------------------------------- buttons */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-ctl);
  border: 1px solid transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, filter 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:active { transform: scale(0.985); }

.btn-primary {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #fff;
  box-shadow: 0 12px 26px -10px rgba(37, 99, 235, 0.55);
}

.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(37, 99, 235, 0.65); }
.btn-primary:disabled { filter: saturate(0.4) brightness(0.9); cursor: default; transform: none; }

.btn-ms {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-ms:hover { background: var(--page); border-color: var(--text-3); transform: translateY(-1px); }

.btn .arrow { transition: transform 0.15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  display: none;
}

form.busy .spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- dropzone */

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 28px 16px;
  text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  background: #F8FAFD;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.dropzone svg { width: 30px; height: 30px; color: var(--accent); margin-bottom: 4px; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-text { font-size: 14px; color: var(--text-2); }
.dropzone-text strong { color: var(--heading); font-weight: 650; }
.dropzone-text span { display: block; font-size: 12px; color: var(--text-3); margin-top: 5px; }

.filename {
  min-height: 16px;
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-dark);
  word-break: break-all;
}

/* ------------------------------------------------------------ progress bar */

.progress-wrap { margin-top: 22px; }

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-2);
}

.progress-head #progress-pct { font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; }

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--grid);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563EB, #7C6FE3);
  transition: width 0.35s ease;
}

.form-error {
  margin: 18px 0 0;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--critical);
  background: rgba(224, 69, 95, 0.08);
  border: 1px solid rgba(224, 69, 95, 0.3);
}

/* --------------------------------------------------------------- history */

.history-section {
  padding: 8px 40px 72px;
  display: flex;
  justify-content: center;
}

.history-inner { width: min(1084px, 100%); }

.history-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--heading);
}

.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(11, 45, 92, 0.05);
}

.history-file { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.history-name { font-weight: 650; color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-when { font-size: 12.5px; color: var(--text-3); }

.history-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.history-actions a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  color: var(--accent-dark);
  background: var(--surface);
  transition: 0.15s ease;
}

.history-actions a:hover { border-color: var(--accent); background: var(--accent-soft); }

.history-pending { font-size: 12.5px; color: var(--text-3); font-style: italic; }
.history-empty { color: var(--text-3); font-size: 14px; }

/* --------------------------------------------------------- engine cards */

.engine-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.engine-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 14px 13px 36px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.engine-option:hover { border-color: var(--border-strong); }

.engine-option input {
  position: absolute;
  top: 15px;
  left: 13px;
  margin: 0;
  accent-color: var(--accent);
}

.engine-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.engine-option-title { font-size: 13.5px; font-weight: 650; color: var(--heading); }
.engine-option-sub { font-size: 11.5px; color: var(--text-3); }

/* ------------------------------------------------------------ footnotes */

.footnote {
  margin-top: 22px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.6;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  font-size: 13.5px;
  color: var(--text-2);
}

.feature-list li { display: flex; align-items: flex-start; gap: 10px; }

.feature-list li::before {
  content: "\2713";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------- animated gradient text
   Vanilla port of React Bits <GradientText />: a moving linear-gradient
   clipped to the text. Blue-violet palette to match the report theme. */

@keyframes gradient-pan {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.gradient-text {
  background-image: linear-gradient(to right, #2563EB, #7C6FE3, #1A4E8C, #2563EB);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-pan 6s ease-in-out infinite alternate;
}

.card-kicker {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------------------------------------------------- login lead (top row)
   Feature highlights across the top of the login page. */

body.has-lead { display: flex; flex-direction: column; min-height: 100vh; }
body.has-lead .shell { flex: 1 0 auto; min-height: 0; }

.login-lead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  row-gap: 8px;
  padding: 44px 40px 0;
  text-align: center;
}

.login-lead-item {
  display: inline-block;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.vf-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #7C6FE3);
  flex: none;
}

/* ------------------------------------------------------------ focus ring */

a:focus-visible, button:focus-visible, .dropzone:focus-within, .engine-option:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-ctl);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1080px) {
  .shell { gap: 40px; padding: 40px 24px; }
  .hero { order: 2; }
  .card { order: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
