:root {
  --bg: #eef2ef;
  --surface: #ffffff;
  --text: #101820;
  --muted: #65737c;
  --line: #dce3df;
  --primary: #0f766e;
  --primary-dark: #0b5c55;
  --accent: #c7792f;
  --danger: #b42318;
  --success: #16723d;
  --shadow: 0 22px 60px rgba(16, 24, 32, 0.12);
  --radius: 8px;
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 36px);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px var(--gutter);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
  text-decoration: none;
}

.brand span {
  display: inline-grid;
  width: 38px;
  height: 32px;
  margin-right: 8px;
  place-items: center;
  color: white;
  background: var(--text);
  border-radius: var(--radius);
}

.topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.page {
  width: min(100%, var(--container));
  margin: 0 auto;
  padding: 32px var(--gutter) 64px;
}

.calculator-page {
  min-height: calc(100dvh - 66px);
  display: grid;
  align-items: center;
}

.calculator-shell {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(380px, 0.72fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.calculator-title {
  max-width: 660px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(44px, 5.3vw, 68px);
  line-height: 1.03;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1.15;
}

.calculator-title p:not(.eyebrow),
.small-note,
.upload-header p,
.upload-status,
.unlock-status {
  color: var(--muted);
}

.calculator-title p:not(.eyebrow) {
  max-width: 560px;
  color: #44525b;
  font-size: 21px;
  line-height: 1.55;
}

.panel,
.tripwire-card,
.new-resume-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.calculator-form {
  padding: clamp(26px, 4vw, 40px);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  color: #243039;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 50px;
  padding: 12px 13px;
  color: var(--text);
  background: #fbfcfb;
  border: 1px solid #cbd6d0;
  border-radius: var(--radius);
}

input[type="range"] {
  min-height: 34px;
  padding: 0;
  accent-color: var(--primary);
}

.input-wrap {
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #fbfcfb;
  border: 1px solid #cbd6d0;
  border-radius: var(--radius);
}

.input-wrap input {
  border: 0;
  background: transparent;
}

.input-wrap span {
  padding-right: 14px;
  color: var(--muted);
  font-weight: 900;
}

.range-meta,
.score-row,
.loading-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.range-meta {
  color: var(--muted);
  font-size: 14px;
}

.range-meta strong {
  color: var(--text);
}

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 4px 0 18px;
}

.checkbox-row input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--primary);
}

.form-error {
  min-height: 24px;
  margin-bottom: 12px;
  color: var(--danger);
  font-weight: 800;
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: default;
  opacity: 0.72;
  transform: none;
}

.button.primary {
  color: white;
  background: var(--primary);
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.secondary {
  color: var(--text);
  background: white;
  border-color: var(--line);
}

.button.full {
  width: 100%;
}

.button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.26);
  outline-offset: 3px;
}

.is-hidden {
  display: none !important;
}

.result-page {
  padding-top: 28px;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(330px, 0.78fr) minmax(420px, 1fr);
  gap: 22px;
  align-items: stretch;
}

.result-card {
  padding: clamp(22px, 4vw, 34px);
}

.alg-amount {
  margin: 12px 0 22px;
}

.alg-amount span {
  display: block;
  font-size: clamp(48px, 7vw, 76px);
  font-weight: 950;
  line-height: 0.98;
}

.alg-amount small {
  color: var(--muted);
  font-weight: 800;
}

.result-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.result-metrics div {
  padding: 14px;
  background: #f1f5f2;
  border-radius: var(--radius);
}

.result-metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.result-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.breakdown {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.breakdown summary {
  padding: 16px 0 4px;
  cursor: pointer;
  font-weight: 900;
}

.breakdown dl {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
}

.breakdown dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid #edf1ee;
}

.breakdown dt {
  color: var(--muted);
  font-weight: 700;
}

.breakdown dd {
  margin: 0;
  font-weight: 900;
  white-space: nowrap;
}

.tripwire-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 32px;
  align-items: center;
  overflow: hidden;
  min-height: 460px;
  padding: clamp(28px, 4vw, 44px);
  color: white;
  background: #111b24;
}

.tripwire-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.tripwire-card .eyebrow {
  margin-bottom: 14px;
  color: #80e2d7;
}

.tripwire-card h2 {
  max-width: 460px;
  margin-bottom: 16px;
  font-size: clamp(32px, 2.55vw, 44px);
  line-height: 1.08;
}

.tripwire-subline {
  max-width: 440px;
  margin-bottom: 22px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 18px;
  line-height: 1.42;
}

.tripwire-card .button {
  min-width: 330px;
  margin-bottom: 16px;
  background: #12a091;
}

.tripwire-card .small-note {
  max-width: 430px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.resume-ad-image {
  justify-self: end;
  align-self: start;
  position: relative;
  width: 230px;
  min-height: 310px;
  margin-top: 36px;
}

.resume-paper {
  height: 310px;
  padding: 16px;
  color: var(--text);
  background: white;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  transform: rotate(-1.5deg);
}

.resume-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 2px solid #14202a;
}

.resume-head span {
  width: 36px;
  height: 36px;
  background: #cbd8d2;
  border-radius: 50%;
}

.resume-columns {
  display: grid;
  grid-template-columns: 0.62fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.resume-columns i,
.resume-columns b {
  display: block;
  height: 9px;
  margin-bottom: 10px;
  background: #d7dfda;
  border-radius: 999px;
}

.resume-columns b {
  height: 13px;
  background: var(--primary);
}

.resume-columns .short {
  width: 70%;
  margin-top: 28px;
}

.claim-badge {
  position: absolute;
  right: -10px;
  bottom: 20px;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  color: white;
  background: var(--accent);
  border: 7px solid #111b24;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 950;
  text-align: center;
}

.upload-section {
  margin-top: 28px;
}

.upload-header {
  margin-bottom: 16px;
}

.upload-header h2 {
  margin-bottom: 4px;
}

.upload-panel {
  padding: clamp(20px, 4vw, 32px);
}

.upload-box {
  position: relative;
  display: grid;
  min-height: 160px;
  place-items: center;
  padding: 22px;
  text-align: center;
  background: #fbfcfb;
  border: 2px dashed #9eb3aa;
  border-radius: var(--radius);
}

.upload-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-box strong {
  display: block;
  font-size: 22px;
}

.upload-box p {
  margin: 6px 0 14px;
  color: var(--muted);
}

.upload-box .button {
  pointer-events: none;
}

.upload-status {
  min-height: 24px;
  margin: 14px 0 0;
  font-weight: 800;
}

.loading-panel {
  margin-top: 18px;
}

.loading-meta {
  margin-bottom: 10px;
  font-weight: 900;
}

.progress-track {
  overflow: hidden;
  height: 14px;
  background: #e3ebe7;
  border-radius: 999px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #42b883);
  border-radius: inherit;
  transition: width 220ms ease;
}

.analysis-result {
  display: grid;
  grid-template-columns: minmax(330px, 0.8fr) minmax(420px, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 28px;
}

.analysis-card,
.new-resume-card {
  padding: clamp(20px, 4vw, 32px);
}

.score-ring {
  display: flex;
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  align-items: baseline;
  justify-content: center;
  padding-top: 26px;
  color: var(--primary-dark);
  background: conic-gradient(var(--primary) 0 62%, #e1e8e4 62% 100%);
  border-radius: 50%;
  box-shadow: inset 0 0 0 10px #f8fbf8;
}

.score-ring span {
  font-size: 30px;
  font-weight: 950;
}

.analysis-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 22px 0 0;
  list-style: none;
}

.analysis-list li {
  padding: 13px 14px;
  background: #f1f5f2;
  border-radius: var(--radius);
}

.new-resume-card {
  position: relative;
}

.pdf-preview-heading {
  margin: 4px 0 14px;
}

.pdf-preview-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
  font-weight: 950;
}

.new-resume-label {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  padding: 8px 11px;
  color: white;
  background: var(--primary);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.pdf-preview-frame {
  overflow: hidden;
  margin-bottom: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(16, 24, 32, 0.12);
}

.pdf-preview-frame iframe {
  display: block;
  width: 100%;
  height: min(76vh, 760px);
  min-height: 560px;
  background: #f7faf8;
  border: 0;
}

.pdf-preview-fallback {
  display: none;
  padding: 12px 16px;
  color: var(--primary-dark);
  border-top: 1px solid var(--line);
  font-weight: 900;
  text-align: center;
}

.cv-document {
  overflow: hidden;
  margin-bottom: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cv-document header {
  position: relative;
  padding: 28px;
  color: white;
  background: var(--text);
}

.cv-document header.has-photo {
  min-height: 158px;
  padding-right: 150px;
}

.cv-preview-photo {
  position: absolute;
  top: 26px;
  right: 28px;
  width: 96px;
  height: 112px;
  object-fit: cover;
  background: #dce3df;
  border: 3px solid var(--primary);
  border-radius: 6px;
}

.cv-document h3 {
  margin: 0 0 4px;
  font-size: 34px;
}

.cv-document header p,
.cv-document header span {
  color: rgba(255, 255, 255, 0.74);
}

.cv-document section {
  position: relative;
  padding: 22px 28px;
  border-top: 1px solid var(--line);
}

.cv-document h4 {
  margin-bottom: 8px;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.locked-section {
  overflow: hidden;
}

.blur-content {
  filter: blur(5px);
  user-select: none;
}

.locked-section > span {
  position: absolute;
  top: 50%;
  left: 50%;
  padding: 8px 12px;
  color: white;
  background: rgba(16, 24, 32, 0.9);
  border-radius: var(--radius);
  font-weight: 900;
  transform: translate(-50%, -50%);
}

.unlock-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--success);
  font-weight: 800;
}

.unlock-status.error {
  color: var(--danger);
}

@media (max-width: 920px) {
  .calculator-shell,
  .result-grid,
  .analysis-result {
    grid-template-columns: 1fr;
  }

  .tripwire-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .resume-ad-image {
    width: 230px;
    max-width: 230px;
    justify-self: start;
    margin-top: 0;
  }

  .resume-paper {
    height: 310px;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .page {
    padding-top: 22px;
    padding-bottom: 48px;
  }

  h1 {
    font-size: 44px;
  }

  .form-grid,
  .result-metrics {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .tripwire-card,
  .analysis-card,
  .new-resume-card,
  .calculator-form,
  .result-card {
    padding: 20px;
  }

  .tripwire-card h2 {
    font-size: 36px;
  }

  .tripwire-card .button {
    min-width: 0;
  }

  .cv-document header.has-photo {
    min-height: 0;
    padding-right: 28px;
  }

  .cv-preview-photo {
    position: static;
    display: block;
    margin: 16px 0 0;
  }

  .pdf-preview-frame iframe {
    height: 68vh;
    min-height: 460px;
  }

  .breakdown dl div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
