:root {
  --ucs-blue: #0000d2;
  --print-blue: #36479e;
  --black: #000000;
  --white: #ffffff;
  --nobel: #b1b1b1;
  --soft-gray: #f5f5f7;
  --line: #dddddf;
  --ink-muted: #5d5d66;
  --success: #00a676;
  --warning: #f0b429;
  --danger: #db3a34;
  --radius: 8px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
  color-scheme: light;
  font-family: "DM Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--black);
  background-color: var(--white);
  background-image: url("assets/pattern-uniform.png");
  background-repeat: repeat-y;
  background-position: top center;
  background-size: 100% auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.intro-panel {
  min-height: 76vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px clamp(18px, 4vw, 58px) 42px;
  color: var(--white);
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.2), transparent 18rem),
    linear-gradient(135deg, #000000 0%, #05051f 42%, #0000d2 100%);
  overflow: hidden;
}

.topbar,
.hero-grid,
.workspace {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: clamp(118px, 12vw, 172px);
  height: auto;
}

.brand-logo-payoff {
  width: clamp(128px, 13vw, 184px);
}

.empty-logo {
  display: block;
  width: min(260px, 76vw);
  height: auto;
  margin-bottom: 8px;
}

.legal-logo {
  display: block;
  width: 158px;
  height: auto;
}

.brand strong {
  display: block;
  font-size: 1.1rem;
  line-height: 1;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 50%;
  transform: rotate(-20deg);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 18px;
  height: 18px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
  clip-path: polygon(50% 0, 61% 36%, 100% 50%, 61% 64%, 50% 100%, 39% 64%, 0 50%, 39% 36%);
}

.brand-mark::after {
  width: 6px;
  height: 6px;
  transform: translate(68%, -175%) rotate(45deg);
}

.brand-mark.large {
  width: 54px;
  height: 54px;
  color: var(--ucs-blue);
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ucs-blue);
  background: var(--white);
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.ghost-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(310px, 0.55fr);
  align-items: end;
  gap: clamp(28px, 6vw, 78px);
  padding-top: clamp(70px, 10vw, 140px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--ucs-blue);
  font-family: "DM Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intro-panel .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

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

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(3.3rem, 8vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.hero-text {
  max-width: 690px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.55;
}

.hero-actions,
.next-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-action,
.secondary-action,
.submit-button {
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-action,
.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  color: var(--white);
  background: var(--ucs-blue);
  font-weight: 800;
  box-shadow: 0 18px 36px rgba(0, 0, 210, 0.24);
}

.intro-panel .primary-action {
  color: var(--ucs-blue);
  background: var(--white);
  box-shadow: none;
}

.secondary-action {
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--line);
  color: var(--black);
  background: var(--white);
  font-weight: 800;
}

.primary-action:hover,
.secondary-action:hover,
.submit-button:hover {
  transform: translateY(-1px);
}

.signal-board {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 24px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
}

.signal-board::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  pointer-events: none;
}

.signal-main {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 26px;
}

.signal-main span {
  font-size: clamp(5rem, 10vw, 8rem);
  font-weight: 900;
  line-height: 0.78;
}

.signal-main small {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  font-weight: 800;
}

.signal-list {
  display: grid;
  gap: 12px;
}

.signal-list p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.signal-list span {
  color: rgba(255, 255, 255, 0.7);
  text-align: right;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(310px, 0.78fr) minmax(0, 1fr);
  gap: 22px;
  padding: 24px clamp(18px, 4vw, 0px) 58px;
  transform: translateY(-34px);
}

.assessment-form,
.report-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.assessment-form {
  display: grid;
  gap: 18px;
  align-self: start;
  padding: clamp(18px, 3vw, 28px);
}

.form-header p {
  color: var(--ink-muted);
  line-height: 1.5;
}

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

.field-grid.two {
  grid-template-columns: 1fr 1fr;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.choice-group legend {
  font-size: 0.82rem;
  font-weight: 900;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 13px;
  color: var(--black);
  background: var(--white);
  outline: none;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ucs-blue);
  box-shadow: 0 0 0 3px rgba(0, 0, 210, 0.1);
}

.choice-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.choice-group legend {
  padding: 0 6px;
}

.choice-group label {
  display: flex;
  align-items: start;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.25;
}

.choice-group input {
  accent-color: var(--ucs-blue);
  margin-top: 2px;
}

.objective-group {
  grid-template-columns: 1fr;
}

.file-drop {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 14px;
  border: 1px dashed var(--ucs-blue);
  border-radius: var(--radius);
  color: var(--black);
  background: rgba(0, 0, 210, 0.04);
  cursor: pointer;
}

.file-drop input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--white);
  background: var(--ucs-blue);
  font-weight: 900;
}

.file-drop small {
  display: block;
  margin-top: 2px;
  color: var(--ink-muted);
}

.submit-button {
  justify-content: space-between;
  width: 100%;
  min-height: 56px;
  font-size: 1rem;
}

.privacy-check {
  display: flex;
  align-items: start;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-muted);
  background: var(--soft-gray);
  font-size: 0.84rem;
  line-height: 1.35;
}

.privacy-check input {
  flex: 0 0 auto;
  accent-color: var(--ucs-blue);
  margin-top: 2px;
}

.report-panel {
  min-height: 720px;
  padding: clamp(18px, 3vw, 28px);
}

.empty-state,
.loading-state {
  display: grid;
  place-items: center;
  min-height: 640px;
  text-align: center;
}

.empty-state p,
.loading-state p {
  max-width: 430px;
  color: var(--ink-muted);
  line-height: 1.55;
}

.scanner {
  width: 112px;
  height: 112px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: conic-gradient(from 20deg, var(--ucs-blue), transparent 34%, var(--success), transparent 68%, var(--ucs-blue));
  animation: spin 1.2s linear infinite;
}

.scanner::after {
  content: "";
  display: block;
  width: 84px;
  height: 84px;
  margin: 14px;
  border-radius: 50%;
  background: var(--white);
}

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

.hidden {
  display: none !important;
}

.report {
  display: grid;
  gap: 20px;
}

.report-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
}

.report-header p {
  color: var(--ink-muted);
  line-height: 1.5;
}

.score-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 134px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft-gray);
}

.score-card span {
  font-size: 0.78rem;
  font-weight: 900;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 98px;
  height: 98px;
  border-radius: 50%;
  background: conic-gradient(var(--ucs-blue) 0deg, var(--line) 0deg);
}

.score-ring::before {
  content: "";
  position: absolute;
}

.score-ring strong,
.score-ring small {
  grid-area: 1 / 1;
  z-index: 1;
}

.score-ring strong {
  margin-top: -10px;
  font-size: 1.8rem;
}

.score-ring small {
  margin-top: 34px;
  color: var(--ink-muted);
  font-weight: 800;
}

.score-ring {
  position: relative;
}

.score-ring::after {
  content: "";
  grid-area: 1 / 1;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--white);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-items: stretch;
}

.kpi-row div {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}

.kpi-row span {
  display: block;
  align-self: end;
  min-width: 0;
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  font-weight: 900;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.kpi-row small {
  color: var(--ink-muted);
}

.chart-block,
.recommendation-grid,
.agent-brief,
.deduction-grid {
  display: grid;
  gap: 14px;
}

.chart-block,
.agent-brief {
  grid-template-columns: 1fr 1fr;
}

.recommendation-grid {
  grid-template-columns: 1fr;
}

.deduction-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.chart-block > div,
.recommendation-grid > section,
.agent-brief > div,
.deduction-card,
.documents-block,
.next-step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--white);
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-row header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft-gray);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ucs-blue), var(--success));
}

.timeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.timeline li {
  padding-left: 4px;
  color: var(--ink-muted);
  line-height: 1.35;
}

.timeline strong {
  color: var(--black);
}

.cert-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.cert-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--ucs-blue);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--soft-gray);
}

.cert-card.recommended {
  border-left-color: var(--success);
}

.cert-card h4 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 0.98rem;
}

.cert-card h4 span {
  color: var(--ucs-blue);
  white-space: nowrap;
}

.cert-card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.documents-block p {
  color: var(--ink-muted);
  line-height: 1.5;
}

.document-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.document-tags span {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft-gray);
  font-size: 0.86rem;
  font-weight: 800;
}

.agent-brief ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
}

.agent-brief li {
  color: var(--ink-muted);
  line-height: 1.42;
}

.deduction-card {
  display: grid;
  grid-template-rows: auto minmax(44px, auto) 1fr;
  gap: 9px;
  min-width: 0;
  min-height: 138px;
  align-content: stretch;
  overflow: hidden;
}

.deduction-card strong {
  display: block;
  min-width: 0;
  font-size: clamp(0.98rem, 1.2vw, 1.18rem);
  line-height: 1.14;
  overflow-wrap: anywhere;
  word-break: normal;
}

.deduction-card span {
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.deduction-card small {
  display: -webkit-box;
  color: var(--ink-muted);
  line-height: 1.3;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.next-step {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 16px;
  align-items: center;
  color: var(--white);
  border-color: var(--ucs-blue);
  background: linear-gradient(135deg, var(--black), var(--ucs-blue));
}

.next-step .eyebrow,
.next-step p {
  color: rgba(255, 255, 255, 0.76);
}

.next-step h3 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.next-step .secondary-action {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--white);
  background: rgba(255, 255, 255, 0.16);
}

.next-step .primary-action,
.next-step .secondary-action {
  min-height: 56px;
  flex: 1 1 210px;
}

.next-step .next-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
}

.next-step .secondary-action {
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.next-step .call-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 18px;
  border-color: rgba(255, 255, 255, 0.82);
  color: var(--black);
  background: rgba(255, 255, 255, 0.94);
  font-weight: 800;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.22);
}

.next-step .call-action:hover {
  background: var(--white);
  box-shadow: 0 22px 38px rgba(0, 0, 0, 0.28);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.58);
}

.quote-modal {
  position: relative;
  width: min(760px, 100%);
  max-height: min(90vh, 860px);
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 34px);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--black);
  background: var(--white);
  cursor: pointer;
  font-weight: 900;
}

.modal-header {
  max-width: 620px;
  margin-bottom: 20px;
}

.modal-header p {
  color: var(--ink-muted);
  line-height: 1.5;
}

.quote-form {
  display: grid;
  gap: 18px;
}

.quote-cert-group {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.quote-cert-group legend {
  padding: 0 6px;
  font-size: 0.82rem;
  font-weight: 900;
}

#quoteCertOptions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

#quoteCertOptions label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 52px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft-gray);
  font-weight: 800;
  line-height: 1.25;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-actions .primary-action,
.modal-actions .secondary-action {
  min-height: 48px;
  padding: 0 16px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--white);
  background: var(--black);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.legal-page {
  width: min(860px, calc(100% - 36px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.legal-brand {
  color: var(--black);
  margin-bottom: 28px;
}

.legal-brand small {
  color: var(--ink-muted);
}

.legal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 42px);
  background: var(--white);
  box-shadow: var(--shadow);
}

.legal-card h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.legal-card h2 {
  margin-top: 28px;
  font-size: 1.3rem;
}

.legal-card p {
  color: var(--ink-muted);
  line-height: 1.6;
}

@media (max-width: 980px) {
  .hero-grid,
  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace {
    transform: none;
    padding-top: 22px;
  }
}

@media (max-width: 680px) {
  .intro-panel {
    min-height: auto;
  }

  .topbar {
    align-items: center;
  }

  .ghost-link {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.82rem;
  }

  .field-grid,
  .field-grid.two,
  .choice-group,
  .report-header,
  .chart-block,
  .recommendation-grid,
  .agent-brief,
  .deduction-grid,
  .kpi-row,
  .next-step {
    grid-template-columns: 1fr;
  }

  .report-panel {
    min-height: auto;
  }

  .empty-state,
  .loading-state {
    min-height: 420px;
  }

  .next-actions {
    width: 100%;
  }

  .next-actions .primary-action,
  .next-actions .secondary-action {
    width: 100%;
  }
}

@media print {
  body {
    background: var(--white);
  }

  .intro-panel,
  .assessment-form,
  .toast {
    display: none;
  }

  .workspace {
    display: block;
    width: 100%;
    padding: 0;
    transform: none;
  }

  .report-panel {
    box-shadow: none;
    border: 0;
  }
}
