* {
  box-sizing: border-box;
}

html {
  background: #f5f7f8;
  color: #090b17;
  font-family: Aeonik, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  min-width: 320px;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

.topbar {
  background: #231d40;
  color: #ffffff;
  border-bottom: 1px solid #332a5c;
}

.topbar-inner {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  font-weight: 650;
}

.topbar a {
  color: #d8fbf6;
  font-weight: 600;
  text-decoration: none;
}

.topbar a:hover {
  text-decoration: underline;
}

.page-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.intro-band {
  padding: 0 0 24px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.insight-logo {
  display: block;
  width: 228px;
  height: auto;
  max-width: 66vw;
}

.powered-badge {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid #f22f46;
  border-radius: 8px;
  background: #ffffff;
  color: #f22f46;
  font-weight: 650;
  line-height: 1;
}

.powered-text {
  font-size: 18px;
}

.twilio-word {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 800;
}

.twilio-icon {
  width: 30px;
  height: 30px;
  border: 3px solid #f22f46;
  border-radius: 50%;
  display: grid;
  grid-template-columns: repeat(2, 7px);
  grid-template-rows: repeat(2, 7px);
  gap: 4px;
  place-content: center;
}

.twilio-icon span {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f22f46;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 720px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 0.98;
  letter-spacing: 0;
  font-weight: 760;
  color: #090b17;
}

.intro-grid p {
  max-width: 760px;
  margin-top: 14px;
  color: #344153;
  font-size: 16px;
  line-height: 1.65;
}

.overview-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #139e85;
  border-radius: 8px;
  color: #0f7f6b;
  background: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.overview-link:hover {
  background: #e7f7f4;
}

.intake-form {
  background: #ffffff;
  border: 1px solid #dce5e8;
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(9, 11, 23, 0.07);
  overflow: hidden;
}

.form-section {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  padding: 28px;
  border-bottom: 1px solid #e3ebee;
}

.section-side h2 {
  color: #06342f;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 760;
  letter-spacing: 0;
}

.section-side p {
  margin-top: 10px;
  color: #4a586a;
  font-size: 13px;
  line-height: 1.55;
}

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

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

.field,
.file-field {
  display: block;
  min-width: 0;
}

.field span,
.file-field span {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-height: 18px;
  color: #0d1324;
  font-size: 14px;
  font-weight: 700;
}

.field b {
  color: #f22f46;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 8px;
  border: 1px solid #cbd8de;
  border-radius: 6px;
  background: #ffffff;
  color: #090b17;
  font: inherit;
  font-size: 14px;
  outline: none;
  padding: 0 12px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input,
select {
  height: 44px;
}

textarea {
  min-height: 96px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #139e85;
  box-shadow: 0 0 0 3px rgba(19, 158, 133, 0.16);
}

input.invalid,
select.invalid,
textarea.invalid {
  border-color: #d92d20;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12);
}

small,
.field-error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: #66758a;
}

.field-error {
  color: #b42318;
  font-weight: 650;
}

input[type="file"] {
  height: auto;
  min-height: 52px;
  padding: 12px;
  border-style: dashed;
  background: #f7fafb;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: #139e85;
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  padding: 0 12px;
}

.duplicate-notice {
  margin-top: 14px;
  border: 1px solid #f3bc52;
  border-radius: 8px;
  background: #fff8e7;
  color: #5c3200;
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.duplicate-notice[data-state="clear"] {
  border-color: #b9e5d7;
  background: #eefaf6;
  color: #064e3b;
}

.form-actions {
  padding: 24px 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.form-actions p {
  color: #526174;
  font-size: 13px;
  line-height: 1.55;
}

.override-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #5c3200;
  font-size: 14px;
  font-weight: 650;
}

.override-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #139e85;
}

button {
  min-height: 44px;
  border: 1px solid #139e85;
  border-radius: 8px;
  background: #139e85;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 760;
  padding: 0 18px;
  white-space: nowrap;
}

button:hover {
  background: #0f7f6b;
}

.button-secondary {
  background: #ffffff;
  color: #231d40;
  border-color: #9ca5b4;
}

.button-secondary:hover {
  background: #f1f4f5;
}

.button-danger {
  background: #ffffff;
  color: #b42318;
  border-color: #d92d20;
}

.button-danger:hover {
  background: #fff3f1;
}

button:disabled {
  cursor: not-allowed;
  border-color: #9aa9b6;
  background: #9aa9b6;
}

.status-message {
  margin: 0 28px 28px;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
}

.status-message[data-state="success"] {
  border: 1px solid #a9dbc9;
  background: #eefaf6;
  color: #064e3b;
}

.status-message[data-state="error"] {
  border: 1px solid #f7c2bc;
  background: #fff3f1;
  color: #8a1f11;
}

.toast-region {
  position: fixed;
  top: 72px;
  right: max(16px, calc((100vw - 1120px) / 2));
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 14px 42px 14px 16px;
  border: 1px solid #a9dbc9;
  border-radius: 8px;
  background: #eefaf6;
  color: #064e3b;
  box-shadow: 0 18px 48px rgba(9, 11, 23, 0.16);
  pointer-events: auto;
}

.toast[data-state="error"] {
  border-color: #f7c2bc;
  background: #fff3f1;
  color: #8a1f11;
}

.toast strong {
  font-size: 14px;
  line-height: 1.2;
}

.toast span {
  font-size: 13px;
  line-height: 1.45;
}

.toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: currentColor;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.toast-close:hover {
  background: rgba(9, 11, 23, 0.06);
}

.review-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, auto);
  gap: 24px;
  align-items: end;
}

.review-heading p {
  max-width: 660px;
  margin-top: 14px;
  color: #344153;
  font-size: 16px;
  line-height: 1.55;
}

.review-meta {
  justify-self: end;
  max-width: 360px;
  border: 1px solid #cbd8de;
  border-radius: 8px;
  background: #ffffff;
  color: #344153;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.meta-item {
  display: grid;
  gap: 2px;
}

.meta-item span {
  color: #66758a;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.meta-item strong {
  color: #263447;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.button-row {
  display: inline-flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.pdf-note {
  border: 1px solid #b9e5d7;
  border-radius: 8px;
  background: #eefaf6;
  color: #064e3b !important;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.pdf-note strong,
.pdf-note span {
  display: block;
  font-size: 13px;
  line-height: 1.45;
}

.proof-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.proof-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #139e85;
  border-radius: 6px;
  color: #0f7f6b;
  background: #ffffff;
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
}

.proof-actions a:hover {
  background: #e7f7f4;
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100vw - 24px, 680px);
    padding-top: 24px;
  }

  .topbar-inner {
    width: min(100vw - 24px, 680px);
  }

  .brand-row {
    align-items: flex-start;
  }

  .powered-badge {
    padding: 7px 10px;
  }

  .powered-text {
    font-size: 15px;
  }

  .twilio-word {
    font-size: 20px;
  }

  .intro-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .overview-link {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .form-section {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px 18px;
  }

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

  .form-actions {
    grid-template-columns: 1fr;
    padding: 22px 18px;
  }

  .review-heading {
    grid-template-columns: 1fr;
  }

  .review-meta {
    justify-self: stretch;
    max-width: none;
  }

  .button-row {
    display: grid;
    width: 100%;
    gap: 10px;
  }

  .toast-region {
    top: 64px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  button {
    width: 100%;
  }

  .toast-close {
    width: 28px;
    min-height: 28px;
  }

  .status-message {
    margin: 0 18px 22px;
  }
}

@media (max-width: 520px) {
  .topbar-inner {
    min-height: 52px;
    font-size: 13px;
  }

  .insight-logo {
    width: 190px;
  }

  h1 {
    font-size: 34px;
  }

  .intro-grid p {
    font-size: 15px;
  }
}
