:root {
  --navy: #153a5b;
  --ink: #152331;
  --muted: #5d6a78;
  --teal: #0f8b8d;
  --teal-dark: #096f71;
  --mint: #e9f7f5;
  --mint-strong: #d8f1ed;
  --paper: #ffffff;
  --line: #cfe2e2;
  --soft: #f3f8f8;
  --warning: #fff4d6;
  --shadow: 0 24px 70px rgba(21, 58, 91, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 14%, rgba(15, 139, 141, 0.16), transparent 28%),
    linear-gradient(135deg, #f7fbfb 0%, #eef7f6 48%, #e6f2f5 100%);
}

button,
input {
  font: inherit;
}

.page-shell {
  width: 100%;
  height: 100dvh;
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(380px, 0.88fr);
  gap: 24px;
  padding: 28px;
  overflow: hidden;
}

.grant-panel,
.form-panel {
  min-width: 0;
  min-height: 0;
}

.grant-panel {
  position: relative;
  height: 100%;
  border: 1px solid rgba(15, 139, 141, 0.2);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  padding: 34px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.grant-panel::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -120px;
  width: 310px;
  height: 310px;
  border-radius: 50%;
  background: rgba(15, 139, 141, 0.1);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--teal);
  color: white;
  font-weight: 800;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--teal-dark);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 14px;
  color: var(--navy);
  font-size: 52px;
  line-height: 1.02;
}

.lead {
  max-width: 760px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.metrics article {
  min-height: 98px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fdfc, var(--mint));
  padding: 18px;
}

.metrics strong {
  display: block;
  color: var(--teal-dark);
  font-size: 31px;
  line-height: 1;
  margin-bottom: 8px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.key-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.key-list div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 1px solid rgba(207, 226, 226, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 14px;
}

.check {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--mint-strong);
  color: var(--teal-dark);
  font-weight: 900;
}

.key-list p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.25;
}

.key-list strong {
  color: var(--ink);
}

.official-link {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin-top: auto;
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 2px solid rgba(15, 139, 141, 0.28);
}

.form-panel {
  display: grid;
  place-items: center;
}

.form-card {
  width: 100%;
  max-width: 540px;
  border-radius: 24px;
  border: 1px solid rgba(21, 58, 91, 0.12);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  padding: 28px;
}

.form-heading h2 {
  margin-bottom: 10px;
  color: var(--navy);
  font-size: 34px;
  line-height: 1.08;
}

.form-heading p:not(.eyebrow) {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

input {
  width: 100%;
  height: 50px;
  border: 1px solid #cad7df;
  border-radius: 14px;
  background: #f9fbfc;
  color: var(--ink);
  padding: 0 14px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input:focus {
  border-color: var(--teal);
  background: white;
  box-shadow: 0 0 0 4px rgba(15, 139, 141, 0.13);
}

input[type="range"] {
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  accent-color: var(--teal);
  box-shadow: none;
  cursor: pointer;
}

input[type="range"]:focus {
  background: transparent;
  box-shadow: none;
}

.calculator {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(15, 139, 141, 0.2);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(233, 247, 245, 0.92), rgba(255, 255, 255, 0.88));
  padding: 14px;
}

.budget-field {
  gap: 8px;
}

.budget-field span {
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.budget-field strong {
  color: var(--teal-dark);
  font-size: 25px;
  line-height: 1;
}

.calc-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.calc-results article {
  min-width: 0;
  border: 1px solid rgba(207, 226, 226, 0.92);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  padding: 10px;
}

.calc-results span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.calc-results strong {
  display: block;
  color: var(--navy);
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}

.calc-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

button {
  height: 54px;
  margin-top: 6px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--teal), var(--navy));
  color: white;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(15, 139, 141, 0.24);
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.form-note,
.success-message {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.success-message {
  min-height: 18px;
  color: var(--teal-dark);
  font-weight: 800;
}

@media (max-width: 950px) {
  .page-shell {
    min-height: 560px;
    grid-template-columns: 1fr 360px;
    gap: 14px;
    padding: 16px;
  }

  .grant-panel,
  .form-card {
    border-radius: 18px;
    padding: 22px;
  }

  .brand-row {
    margin-bottom: 12px;
  }

  h1 {
    font-size: 34px;
  }

  .lead {
    font-size: 14px;
    margin-bottom: 14px;
  }

  .metrics {
    gap: 8px;
    margin-bottom: 12px;
  }

  .metrics article {
    min-height: 76px;
    padding: 12px;
  }

  .metrics strong {
    font-size: 23px;
  }

  .metrics span,
  .key-list p {
    font-size: 12px;
  }

  .key-list {
    gap: 7px;
  }

  .key-list div {
    min-height: 46px;
    padding: 7px 10px;
  }

  .form-heading h2 {
    font-size: 25px;
  }

  .calculator {
    gap: 8px;
    padding: 12px;
  }

  .budget-field strong {
    font-size: 22px;
  }

  .calc-results article {
    padding: 8px;
  }

  .calc-results strong {
    font-size: 15px;
  }

  input {
    height: 44px;
  }

  button {
    height: 48px;
  }
}

@media (max-width: 760px) {
  .page-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 0.78fr;
    min-height: 660px;
  }

  .grant-panel {
    padding: 18px;
  }

  .form-card {
    max-width: none;
    padding: 16px;
  }

  .brand-row,
  .lead,
  .official-link {
    display: none;
  }

  .eyebrow {
    font-size: 11px;
    margin-bottom: 6px;
  }

  h1 {
    font-size: 26px;
    margin-bottom: 10px;
  }

  .metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .metrics article {
    min-height: 60px;
    padding: 9px;
  }

  .metrics strong {
    font-size: 20px;
  }

  .metrics span {
    font-size: 10px;
  }

  .key-list div {
    min-height: 38px;
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .check {
    width: 24px;
    height: 24px;
  }

  .key-list p {
    font-size: 11px;
  }

  .form-heading h2 {
    font-size: 22px;
  }

  .form-heading p:not(.eyebrow),
  .form-note {
    display: none;
  }

  form {
    gap: 8px;
  }

  label {
    gap: 4px;
    font-size: 12px;
  }

  .calculator {
    gap: 7px;
    padding: 10px;
    border-radius: 14px;
  }

  .budget-field span {
    font-size: 11px;
  }

  .budget-field strong {
    font-size: 19px;
  }

  .calc-results {
    gap: 6px;
  }

  .calc-results article {
    padding: 7px;
  }

  .calc-results span,
  .calc-note {
    font-size: 10px;
  }

  .calc-results strong {
    font-size: 12px;
  }
}
