:root {
  --ink: #182230;
  --muted: #667085;
  --paper: #f6f7f9;
  --white: #fff;
  --accent: #2457c5;
  --accent-dark: #183f96;
  --accent-soft: #eaf0ff;
  --navy: #101828;
  --line: #dfe3e8;
  --warm: #f4f5f7;
  --warning: #fff4d9;
  --shadow: 0 18px 50px rgba(16, 24, 40, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.site-header, main, footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid rgba(16, 24, 40, .08);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -.02em;
}
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  color: var(--white);
  background: var(--navy);
  font-size: 11px;
  letter-spacing: -.02em;
  font-weight: 850;
}
.trust-pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid #d5dae1;
  border-radius: 999px;
  color: #475467;
  background: var(--white);
  font-size: 13px;
  font-weight: 700;
}
.trust-pill span { color: var(--accent); }

.hero {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 60px;
  align-items: end;
  padding: 78px 0 58px;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2 {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 720;
  letter-spacing: -.05em;
  line-height: 1.02;
}
h1 { margin-bottom: 24px; max-width: 800px; font-size: clamp(46px, 6.2vw, 76px); }
h1 em { color: var(--accent); font-style: normal; font-weight: 720; }
h2 { margin-bottom: 0; font-size: clamp(32px, 4vw, 46px); }
.hero-copy { max-width: 650px; margin-bottom: 0; color: var(--muted); font-size: 18px; }
.promise-card {
  display: flex;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .05);
}
.promise-card p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.promise-icon {
  display: grid;
  flex: 0 0 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-weight: 900;
}

.workspace {
  margin-bottom: 80px;
  overflow: hidden;
  border: 1px solid #e1e5ea;
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.steps { display: grid; grid-template-columns: repeat(3, 1fr); background: #f2f4f7; }
.step {
  padding: 18px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #84908a;
  background: transparent;
  font-weight: 750;
}
.step span {
  display: inline-grid;
  width: 25px;
  height: 25px;
  margin-right: 7px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
}
.step.active { border-bottom-color: var(--accent); color: var(--accent); background: var(--white); }
.panel { display: none; padding: clamp(28px, 6vw, 70px); }
.panel.active { display: block; animation: rise .3s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 42px;
}
.step-count { color: #a0aaa5; font-size: 13px; letter-spacing: .12em; }
label { display: block; margin-bottom: 9px; font-weight: 800; }
label span { color: var(--accent); }
input[type="url"], textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fbfcfa;
  transition: border-color .2s, box-shadow .2s;
}
input[type="url"] { min-height: 52px; padding: 0 16px; }
textarea { padding: 16px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(36,87,197,.10); }
.url-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.field-help { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.field-help.success { color: var(--accent); }
.field-help.error { color: #a24032; }
.divider { display: flex; align-items: center; gap: 14px; margin: 30px 0; color: #99a29d; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }

.button {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 800;
}
.button.primary { color: white; background: var(--accent); box-shadow: 0 7px 16px rgba(36,87,197,.18); }
.button.primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.button.secondary { border-color: var(--line); color: var(--ink); background: var(--white); }
.button.text { padding-inline: 4px; color: var(--muted); background: transparent; }
.button:disabled { cursor: wait; opacity: .55; }
.actions { display: flex; gap: 10px; margin-top: 32px; align-items: center; }
.actions.right { justify-content: flex-end; }
.actions.split { justify-content: space-between; }

.dropzone {
  display: grid;
  min-height: 235px;
  padding: 28px;
  place-items: center;
  align-content: center;
  border: 2px dashed #bdc8c1;
  border-radius: 18px;
  color: var(--muted);
  background: #fafbf9;
  text-align: center;
  transition: .2s;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: #f6f8ff; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone strong { margin: 10px 0 4px; color: var(--ink); font-size: 18px; }
.upload-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 10px; color: var(--accent); background: var(--accent-soft); font-size: 25px; font-weight: 900; }
.file-name { margin-top: 10px; color: var(--accent); font-weight: 800; }
.rule-card { margin-top: 24px; padding: 22px 24px; border-radius: 14px; background: var(--warm); }
.rule-card ul, .insight-card ul { margin-bottom: 0; padding-left: 20px; }
.rule-card li, .insight-card li { margin: 7px 0; }
.consent { display: flex; gap: 11px; margin-top: 22px; align-items: flex-start; font-weight: 600; color: var(--muted); }
.consent input { margin-top: 5px; accent-color: var(--accent); }
.consent span { color: inherit; }

.loading { padding: 80px 20px; text-align: center; }
.loading p { color: var(--muted); }
.spinner {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border: 4px solid #e2e7e3;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.score-grid { display: grid; grid-template-columns: 180px 1fr; gap: 16px; margin-bottom: 26px; }
.score-card { padding: 20px; border: 1px solid #dce4f6; border-radius: 12px; background: #f5f8ff; }
.score-card > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.score-card > strong { color: var(--accent); font-size: 42px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { padding: 5px 9px; border-radius: 999px; color: var(--accent-dark); background: var(--accent-soft); font-size: 12px; font-weight: 750; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
.result-heading { display: flex; justify-content: space-between; }
.result-heading span { color: var(--accent); font-size: 12px; font-weight: 800; }
#tailored-cv { min-height: 760px; background: white; font-family: Georgia, serif; }
.insight-card { margin-bottom: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; }
.insight-card h3 { margin-bottom: 12px; font-size: 16px; }
.insight-card li { color: var(--muted); font-size: 14px; }
.insight-card.warning { border-color: #ecd9a9; background: var(--warning); }
.error-box { padding: 18px; border: 1px solid #e9b8b0; border-radius: 12px; color: #8f3428; background: #fff0ed; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 0 0 40px; color: var(--muted); font-size: 12px; }
footer span { color: var(--ink); font-weight: 850; }

@media (max-width: 800px) {
  .hero, .result-grid { grid-template-columns: 1fr; }
  .hero { gap: 30px; padding-top: 40px; }
  .score-grid { grid-template-columns: 1fr; }
  .steps .step { font-size: 0; }
  .steps .step span { margin: 0; font-size: 12px; }
  .url-row { grid-template-columns: 1fr; }
  .actions.split { align-items: stretch; flex-direction: column-reverse; }
  .actions.split > div { display: grid; gap: 8px; }
  footer { flex-direction: column; }
}

@media print {
  body * { visibility: hidden; }
  #tailored-cv, #tailored-cv * { visibility: visible; }
  #tailored-cv { position: absolute; inset: 0; width: 100%; border: 0; }
}
