/* ============================================================
   DreamJob USA — app shell design system
   Display: Space Grotesk · Body: Inter · Labels/data: IBM Plex Mono
   Signature element: the radial Fit Score ring (--pct driven via JS)
   ============================================================ */

:root {
  --bg: #F7F8FB;
  --surface: #FFFFFF;
  --ink: #10152B;
  --ink-soft: #545B78;
  --ink-faint: #8489A3;
  --line: #E3E6EF;
  --line-soft: #EEF0F6;

  --primary: #2452F0;
  --primary-dark: #1B3ECC;
  --primary-soft: #EAEFFE;
  --gold: #FFB020;
  --gold-soft: #FFF3DC;
  --success: #16A34A;
  --success-soft: #E9F9EE;
  --danger: #E1432D;
  --danger-soft: #FDECE9;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16,21,43,.04), 0 1px 1px rgba(16,21,43,.03);
  --shadow-md: 0 4px 16px rgba(16,21,43,.06), 0 1px 3px rgba(16,21,43,.04);
  --shadow-lg: 0 12px 40px rgba(16,21,43,.10), 0 2px 8px rgba(16,21,43,.05);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 12px; }
h1 { font-size: 42px; line-height: 1.08; }
h2 { font-size: 26px; line-height: 1.2; }
h3 { font-size: 18px; }
h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
p { line-height: 1.6; color: var(--ink-soft); }
a { color: var(--primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.container { max-width: 980px; margin: 0 auto; padding: 0 24px 80px; }

/* ---------- Top nav ---------- */
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px; border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand { font-family: var(--font-display); font-weight: 700; font-size: 20px; display: flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; }
.brand .dot { color: var(--gold); }
.brand-tagline { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); margin-top: 2px; }
.nav-badge { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); background: var(--line-soft); padding: 6px 14px; border-radius: 20px; }

/* ---------- Modules strip (hero) ---------- */
.modules-strip {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 10px; max-width: 780px; margin: 0 auto 44px; padding: 0 24px;
}
.module-chip {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; padding: 9px 16px 9px 10px; font-size: 12.5px; font-weight: 700; color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.module-num {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; color: #fff; background: var(--primary);
  width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.module-arrow { color: var(--ink-faint); font-size: 14px; }
@media (max-width: 760px) {
  .modules-strip { gap: 6px; }
  .module-arrow { display: none; }
  .module-chip { font-size: 11.5px; }
}

.hiw-jump { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-soft); text-decoration: none; border-bottom: 1px dashed var(--ink-faint); padding-bottom: 2px; }
.hiw-jump:hover { color: var(--primary); border-color: var(--primary); }

/* ---------- How It Works timeline ---------- */
.how-it-works { max-width: 720px; margin: 88px auto 40px; padding: 0 24px; scroll-margin-top: 40px; }
.hiw-head { text-align: center; margin-bottom: 48px; }
.hiw-head .lede { max-width: 480px; margin: 0 auto; }

.hiw-steps { display: flex; flex-direction: column; }
.hiw-step { display: flex; gap: 22px; }
.hiw-marker { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.hiw-num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary);
  color: var(--primary); font-family: var(--font-display); font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-sm);
}
.hiw-line { width: 2px; flex: 1; background: var(--line); margin: 6px 0; min-height: 24px; }
.hiw-content { padding-bottom: 36px; }
.hiw-content h3 { margin-bottom: 6px; }
.hiw-content p { font-size: 14px; max-width: 480px; }
.hiw-step-last .hiw-content { padding-bottom: 0; }

@media (max-width: 760px) {
  .how-it-works { margin-top: 64px; }
  .hiw-content p { max-width: 100%; }
}

/* ---------- Error banner ---------- */
.error-banner {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-160%);
  background: var(--danger-soft); color: var(--danger); border: 1px solid #F5C3B8;
  padding: 13px 22px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  transition: transform .3s cubic-bezier(.2,.8,.2,1); z-index: 200; max-width: 90vw; box-shadow: var(--shadow-md);
}
.error-banner.visible { transform: translateX(-50%) translateY(0); }

/* ---------- Hero / upload ---------- */
.hero { padding: 64px 24px 40px; text-align: center; max-width: 720px; margin: 0 auto; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--primary); background: var(--primary-soft); display: inline-block;
  padding: 6px 14px; border-radius: 20px; margin-bottom: 18px;
}
.hero h1 { margin-bottom: 16px; }
.hero .lede { font-size: 17px; max-width: 560px; margin: 0 auto 8px; }

.upload-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 36px; max-width: 620px; margin: 32px auto 0; text-align: left;
}
.upload-box {
  border: 2px dashed #C9D2F2; border-radius: var(--radius-md); padding: 28px; text-align: center;
  background: var(--primary-soft); margin-bottom: 22px; transition: border-color .2s ease;
}
.upload-box:hover { border-color: var(--primary); }
.upload-box p { margin: 0 0 10px; color: var(--ink); }
.upload-box input[type="file"] { font-family: var(--font-body); font-size: 13px; }
.upload-box textarea { width: 100%; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font-family: var(--font-body); font-size: 13px; resize: vertical; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font-body); background: var(--surface); color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); outline: none;
}

.btn-primary {
  background: var(--primary); color: #fff; border: none; padding: 14px 26px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 14px; cursor: pointer; font-family: var(--font-body);
  box-shadow: 0 2px 10px rgba(36,82,240,.25); transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
  width: 100%;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(36,82,240,.32); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--surface); color: var(--primary); border: 1.5px solid var(--primary);
  padding: 13px 22px; border-radius: var(--radius-sm); font-weight: 700; font-size: 14px; cursor: pointer;
  font-family: var(--font-body); transition: background .15s ease;
}
.btn-secondary:hover { background: var(--primary-soft); }

/* ---------- Loading ---------- */
#screen-loading .container { text-align: center; padding-top: 140px; }
.spinner { width: 44px; height: 44px; margin: 0 auto 24px; border-radius: 50%; border: 4px solid var(--primary-soft); border-top-color: var(--primary); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Signature element: the Fit Score ring ---------- */
.score-ring-wrap { display: flex; flex-direction: column; align-items: center; margin: 8px 0 28px; }
.score-ring {
  --pct: 0; width: 180px; height: 180px; border-radius: 50%; position: relative;
  background: conic-gradient(var(--primary) calc(var(--pct) * 1%), var(--gold) calc(var(--pct) * 1%) calc(var(--pct) * 1% + 3%), var(--line-soft) 0);
  display: flex; align-items: center; justify-content: center;
  transition: --pct 1s ease;
}
.score-ring::before { content: ''; position: absolute; inset: 14px; background: var(--surface); border-radius: 50%; box-shadow: inset 0 1px 4px rgba(16,21,43,.06); }
.score-ring .score-value { position: relative; font-family: var(--font-display); font-size: 44px; font-weight: 700; color: var(--ink); }
.score-ring .score-value span { font-size: 20px; color: var(--ink-faint); }
.score-ring-label { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin-top: 14px; }

/* ---------- Teaser strengths/weaknesses ---------- */
.insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0 36px; }
.insight-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px; }
.insight-card.good { border-top: 3px solid var(--success); }
.insight-card.watch { border-top: 3px solid var(--danger); }
.insight-card h4 { margin-bottom: 12px; }
.insight-card ul { margin: 0; padding-left: 18px; }
.insight-card li { font-size: 13.5px; line-height: 1.6; margin-bottom: 8px; color: var(--ink); }
.blurred { filter: blur(3px); user-select: none; color: var(--ink-faint); }

/* ---------- Paywall cards ---------- */
.paywall-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 8px; }
.paywall-card {
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; background: var(--surface);
  box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease; position: relative;
}
.paywall-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.paywall-card.featured { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.paywall-card .badge { position: absolute; top: -12px; right: 20px; background: var(--gold); color: var(--ink); font-family: var(--font-mono); font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 12px; }
.paywall-card h3 { margin-bottom: 4px; }
.paywall-card .price { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--primary); margin: 10px 0; }
.paywall-card p { font-size: 13.5px; min-height: 60px; }

/* ---------- Dashboard ---------- */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; padding: 24px 0 8px; }
#license-display { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); background: var(--line-soft); padding: 6px 12px; border-radius: 16px; display: inline-block; }

.tab-bar { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 28px; flex-wrap: wrap; }
.tab-btn {
  background: none; border: none; padding: 14px 18px; font-weight: 700; font-size: 13.5px; color: var(--ink-faint);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; font-family: var(--font-body);
  transition: color .15s ease;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .25s ease; }

.jd-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 22px; margin-bottom: 32px; box-shadow: var(--shadow-sm); }

.tag { display: inline-block; padding: 6px 13px; border-radius: 16px; font-size: 12.5px; font-weight: 700; margin: 3px; }
.tag-good { background: var(--success-soft); color: var(--success); }
.gap-card { border-left: 3px solid var(--danger); background: var(--surface); border: 1px solid var(--line); border-left-width: 3px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 14px 16px; margin-bottom: 10px; }
.gap-card strong { font-family: var(--font-display); }
.gap-card .sev { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; color: var(--ink-faint); margin-left: 8px; }
.gap-card p { margin: 6px 0 0; font-size: 13.5px; }

.roadmap-card, .playbook-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.roadmap-card h4 { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); margin: 0; flex: 1; }

/* Roadmap card — subtle left accent instead of a boxed severity pill */
.roadmap-card { border-left: 3px solid var(--line); padding-left: 20px; transition: border-color .15s ease; }
.roadmap-card.sev-major { border-left-color: var(--danger); }
.roadmap-card.sev-moderate { border-left-color: var(--gold); }
.roadmap-card.sev-minor { border-left-color: var(--ink-faint); }
.roadmap-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sev-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sev-dot-major { background: var(--danger); }
.sev-dot-moderate { background: var(--gold); }
.sev-dot-minor { background: var(--ink-faint); }
.sev-label { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.roadmap-why { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; line-height: 1.5; }

.platform-list { display: flex; flex-direction: column; gap: 5px; }
.platform-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink-soft); font-size: 12.5px; transition: background .12s ease;
}
.platform-link:hover { background: var(--line-soft); }
.platform-link strong { color: var(--ink); font-weight: 600; }
.platform-icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--ink-faint); display: flex; }
.platform-icon svg { width: 100%; height: 100%; }
.platform-text { flex: 1; }
.verified-icon { width: 15px; height: 15px; color: var(--success); flex-shrink: 0; }
.verified-icon svg { width: 100%; height: 100%; }

/* Interview Playbook */
.playbook-stage h4 { color: var(--primary); margin: 24px 0 12px; display: flex; align-items: center; gap: 8px; }
.playbook-stage:first-child h4 { margin-top: 0; }
.stage-icon { width: 15px; height: 15px; color: var(--primary); flex-shrink: 0; display: flex; }
.stage-icon svg { width: 100%; height: 100%; }
.playbook-card { display: flex; gap: 12px; align-items: flex-start; }
.playbook-card .topic-icon { width: 18px; height: 18px; color: var(--gold); flex-shrink: 0; margin-top: 2px; display: flex; }
.playbook-card .topic-icon svg { width: 100%; height: 100%; }
.playbook-card strong { font-family: var(--font-display); font-size: 14px; display: block; }
.playbook-card p { margin: 5px 0 0; font-size: 13.5px; }

/* ---------- Resume Studio ---------- */
.mode-toggle { display: flex; gap: 10px; margin-bottom: 20px; }
.mode-btn { border: 1.5px solid var(--line); background: var(--surface); padding: 12px 18px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 700; cursor: pointer; font-family: var(--font-body); transition: all .15s ease; }
.mode-btn.active { border-color: var(--primary); background: var(--primary); color: #fff; }

.template-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.template-picker-btn { border: 1px solid var(--line); background: var(--surface); padding: 10px 15px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font-body); transition: all .15s ease; }
.template-picker-btn:hover { border-color: var(--primary); }
.template-picker-btn.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

#resume-preview-frame { background: var(--surface); box-shadow: var(--shadow-lg); max-width: 700px; margin: 0 auto; border-radius: 4px; overflow: hidden; }

.action-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.action-row .btn-primary, .action-row .btn-secondary { width: auto; }

#cover-letter-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 28px; margin-top: 28px; box-shadow: var(--shadow-sm); }
#cover-letter-box h3::before { content: '✉ '; }

/* ---------- Find Jobs ---------- */
.filter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 8px; }
.filter-checks { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 8px; }
.filter-checks label {
  display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); padding: 9px 14px; border-radius: 20px;
  cursor: pointer; transition: border-color .15s ease;
}
.filter-checks label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.be-tag { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-faint); background: var(--line-soft); padding: 2px 6px; border-radius: 8px; text-transform: uppercase; }
.be-note { font-size: 12.5px; color: var(--ink-faint); margin: 10px 0 22px; line-height: 1.5; }

.job-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow-sm); transition: box-shadow .15s ease; }
.job-card:hover { box-shadow: var(--shadow-md); }
.job-card h4 { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--ink); font-family: var(--font-display); }
.job-card .job-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-soft); margin-bottom: 10px; }
.job-card p { font-size: 13.5px; }
.job-card .job-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.job-card .job-tag { font-size: 11px; font-weight: 700; background: var(--primary-soft); color: var(--primary); padding: 4px 11px; border-radius: 12px; }
.job-card .job-tag.f500 { background: var(--gold-soft); color: #8A6215; }
.job-card a.apply-link { font-weight: 700; color: var(--primary); text-decoration: none; display: inline-block; margin-top: 6px; }
.job-card a.apply-link:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  h1 { font-size: 30px; }
  .paywall-cards { grid-template-columns: 1fr; }
  .insight-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .upload-card { padding: 24px; }
  .topnav { padding: 16px 20px; }
}
