:root {
  --ink: #17202a;
  --muted: #657080;
  --line: #d8dee7;
  --brand: #255c7f;
  --brand-strong: #123d5a;
  --red: #b43a36;
  --panel: #ffffff;
  --page: #eef2f6;
  --side: #172333;
  --shadow: 0 16px 36px rgba(24, 35, 51, 0.12);
  font-family: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
h1, h2, p { margin-top: 0; }

.portal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 34.2vw) minmax(0, 1fr);
}

.portal-side {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 28px;
  padding: 34px 28px;
  background: var(--side);
  color: #f6f8fb;
}

.brand-line {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f0f5;
  color: #17354a;
  font-weight: 800;
}

.brand-line strong {
  display: block;
  font-size: 19px;
  line-height: 1.1;
}

.brand-line small {
  color: #b9c7d6;
  font-size: 13px;
}

.case-visual {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 24px;
  min-height: 560px;
}

.document-stack {
  position: relative;
  width: min(250px, 74%);
  height: 238px;
}

.document-stack span {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.2);
}

.document-stack span:nth-child(1) {
  transform: rotate(-8deg) translate(-16px, 18px);
  background: #c9d1d8;
  opacity: 0.78;
}

.document-stack span:nth-child(2) {
  transform: rotate(6deg) translate(18px, 5px);
  background: #eef2f5;
  opacity: 0.92;
}

.document-stack span:nth-child(3)::before,
.document-stack span:nth-child(3)::after {
  content: "";
  position: absolute;
  left: 32px;
  right: 32px;
  height: 10px;
  border-radius: 999px;
}

.document-stack span:nth-child(3)::before {
  top: 50px;
  background: #d6e2ea;
  box-shadow: 0 34px 0 #e7ebf0, 0 68px 0 #e7ebf0, 0 102px 0 #e7ebf0;
}

.document-stack span:nth-child(3)::after {
  bottom: 42px;
  width: 43%;
  right: auto;
  background: #9fb8ca;
}

.calculation-card {
  width: min(260px, 78%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.08);
}

.calculation-card small {
  display: block;
  margin-bottom: 5px;
  color: #c9d7e5;
  font-size: 13px;
}

.calculation-card strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
}

.portal-main {
  padding: 32px min(4.6vw, 58px) 34px;
}

.portal-header {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 31px;
  line-height: 1.12;
}

.portal-header p:last-child {
  max-width: 860px;
  margin: 0;
  color: #314052;
  font-size: 15px;
  line-height: 1.45;
}

.intake-form {
  display: grid;
  gap: 16px;
}

.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

h2 {
  margin-bottom: 16px;
  color: var(--brand-strong);
  font-size: 18px;
  line-height: 1.2;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.wide { grid-column: 1 / -1; }

label {
  display: grid;
  gap: 6px;
  color: #314052;
  font-size: 13px;
  font-weight: 700;
}

input, select {
  width: 100%;
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 400;
}

input:focus, select:focus {
  outline: 2px solid rgba(37, 92, 127, 0.16);
  border-color: var(--brand);
}

input[readonly] {
  background: #f1f5f8;
  color: var(--brand-strong);
  font-weight: 800;
}

.upload-field input {
  min-height: 42px;
  border-style: dashed;
  background: #fbfcfe;
  padding: 8px;
}

.consent-row {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  border: 1px solid #cbd6e2;
  border-radius: 8px;
  padding: 12px 13px;
  background: #fbfcfe;
  font-size: 13px;
  font-weight: 600;
}

.consent-row input {
  width: 17px;
  min-height: 17px;
  margin-top: 1px;
}

.result-box {
  display: none;
  border: 1px solid #cbd6e2;
  border-radius: 8px;
  padding: 13px;
  background: #f4f8fb;
  color: #314052;
}

.result-box.show { display: block; }
.result-box.error {
  border-color: #dfb7b5;
  background: #fff5f4;
  color: var(--red);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.primary-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 17px;
  background: var(--brand);
  color: white;
  white-space: nowrap;
}

.primary-button:hover { background: var(--brand-strong); }
.primary-button:disabled { opacity: 0.65; cursor: wait; }

.thank-you-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 24px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.thank-you-panel h2 {
  margin-bottom: 12px;
  color: var(--brand-strong);
  font-size: 28px;
}

.thank-you-panel p {
  max-width: 720px;
  margin-bottom: 10px;
  color: #314052;
  font-size: 16px;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.thank-you-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 14px;
  border-radius: 7px;
  padding: 0 20px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(37, 92, 127, 0.18);
}

.thank-you-cta:hover {
  background: var(--brand-strong);
}

@media (max-width: 980px) {
  .portal-shell { grid-template-columns: 1fr; }
  .portal-side {
    position: relative;
    min-height: 170px;
    padding: 20px;
  }
  .case-visual { display: none; }
  .portal-main { padding: 22px 14px 32px; }
}

@media (max-width: 720px) {
  .field-grid { grid-template-columns: 1fr; }
  .wide { grid-column: span 1; }
  h1 { font-size: 27px; }
}
