:root {
  /* Mirror Nymble Monitor brand palette (nymble_agent/nymble_monitor/brand/colors.py) */
  --nymble-rust: #631300;
  --nymble-carrot: #ea492a;
  --nymble-gold: #eda94f;
  --nymble-camel: #ba5b18;
  --nymble-birch: #fcebd3;
  --nymble-cream: #fffbf6;
  --nymble-linen: #f3f1e5;

  --bg: var(--nymble-linen);
  --card: transparent;
  --text: #000000;
  --muted: #000000;
  --border: #a9a9a9;
  --accent: var(--nymble-carrot);
  --accent-2: var(--nymble-gold);
  --danger: #b42318;
  --shadow: none;
  --radius: 16px;
  --radius-sm: 12px;
  --max: 920px;
  --brand-max: 920px;
  --brand-gap: 72px;
  /* Keep the form narrower on desktop so it doesn't feel oversized. */
  --form-max: 560px;
}

@font-face {
  font-family: "Filson Pro";
  src: url("./assets/fonts/FilsonProRegular.woff2") format("woff2"),
    url("./assets/fonts/FilsonProRegular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html.js-pending .brand {
  visibility: hidden;
}

body {
  margin: 0;
  --font-body: "Source Sans Pro", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 34px 24px;
}

.hero {
  padding: 62px 0 0;
}

.brand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: var(--brand-gap);
  padding: 0;
  width: 100%;
  max-width: var(--brand-max);
  margin: 0 auto;
}

.nymble-logo-img {
  display: block;
  height: 118px;
  width: auto;
  max-width: 340px;
  object-fit: contain;
  /* If the asset 404s, keep alt text from flashing in the layout. */
  font-size: 0;
  line-height: 0;
}

.nymble-logo-center {
  display: block;
  height: 196px;
  width: auto;
  max-width: 420px;
  object-fit: contain;
  font-size: 0;
  line-height: 0;
}

.brand-plus {
  font-weight: 800;
  color: var(--accent-2);
  font-size: 70px;
  line-height: 1;
}

#nymble-left-logo {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
}

#nymble-center-logo {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
}

#brand-plus {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
}

#customer-branding {
  grid-column: 3;
  grid-row: 1;
  display: grid;
  place-items: center;
  min-width: 220px;
  min-height: 98px;
  justify-self: start;
}

.wellster-lockup {
  grid-column: 1 / 4;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

.wellster-lockup-image {
  display: block;
  width: 100%;
  max-width: 680px;
  height: auto;
}

#customer-branding.has-logo {
  background: transparent;
  border: none;
  padding: 0;
}

.customer-logo {
  display: block;
  height: 86px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  font-size: 0;
  line-height: 0;
}

.customer-name {
  font-weight: 400;
  font-size: 44px;
  line-height: 1;
  color: var(--text);
  max-width: 320px;
  text-align: center;
}

body.shift-brand-mode .customer-name {
  color: var(--accent-2);
  font-weight: 300;
  font-size: 56px;
  line-height: 1.02;
  max-width: 240px;
  text-align: left;
  white-space: pre-line;
}

.card {
  margin-top: 24px;
  background: var(--card);
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.hidden {
  display: none !important;
}

.loading {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 12px;
  padding: 34px 16px;
}

.spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

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

.error-title {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  color: var(--text);
}

.error-text {
  margin: 10px 0 0;
  color: var(--text);
}

.form-title {
  margin: 14px auto 0;
  text-align: center;
  font-size: 40px;
  line-height: 1.15;
  font-weight: 400;
  color: var(--text);
}

.alert {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(180, 35, 24, 0.25);
  background: rgba(180, 35, 24, 0.06);
  color: var(--danger);
}

.description {
  margin: 56px auto 40px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-line;
  text-align: center;
  font-size: 16px;
  /* Align copy width with the form width for a tighter, calmer layout. */
  max-width: min(620px, var(--form-max));
}

.description p {
  margin: 0 0 12px;
}

.description ul {
  margin: 0;
  padding-left: 18px;
}

.description:empty {
  display: none;
}

.description::after {
  display: none;
}

body.wellster-mode .description::after {
  content: "";
  display: block;
  width: 42px;
  height: 1px;
  background: var(--accent-2);
  margin: 14px auto 0;
  opacity: 0.9;
}

body.demo-mode .hero {
  padding-top: 38px;
}

body.demo-mode .brand {
  grid-template-columns: 1fr;
  max-width: 180px;
}

body.demo-mode #nymble-left-logo {
  display: none !important;
}

body.demo-mode #brand-plus {
  display: none !important;
}

body.demo-mode #customer-branding {
  display: none !important;
}

body.demo-mode #nymble-center-logo {
  grid-column: 1;
  display: block !important;
  height: 126px;
  max-width: 126px;
}

body.demo-mode .form-title {
  display: block;
  font-family: "Filson Pro", var(--font-body);
  font-size: 34px;
}

body.demo-mode .description {
  margin: 22px auto 24px;
  max-width: var(--form-max);
  text-align: center;
  white-space: normal;
  font-size: 14px;
  color: var(--text);
}

body.demo-mode .description ul {
  display: inline-block;
  max-width: 100%;
  text-align: left;
}

body.demo-mode .description::after {
  display: none;
}

body.wellster-lockup-mode .brand {
  grid-template-columns: 1fr;
  max-width: 760px;
  column-gap: 0;
}

body.demo-mode form {
  max-width: var(--form-max);
  gap: 16px;
}

body.demo-mode .field label {
  font-size: 14px;
}

body.demo-mode .disclaimer {
  font-size: 14px;
}

/* Completion page: big centered confirmation + "submit another" CTA. */
body.completion-page .hero {
  padding: 24px 0 0;
}

body.completion-page .wrap {
  padding-top: 26px;
}

body.completion-page .brand {
  grid-template-columns: 1fr;
  column-gap: 0;
  row-gap: 14px;
  max-width: 420px;
  margin: 0 auto;
  justify-items: center;
  align-items: center;
}

body.completion-page #nymble-left-logo,
body.completion-page #nymble-center-logo,
body.completion-page #brand-plus,
body.completion-page #customer-branding,
body.completion-page #wellster-lockup {
  grid-column: 1;
  grid-row: auto;
  justify-self: center;
}

body.completion-page .nymble-logo-img {
  height: 86px;
  max-width: 260px;
}

body.completion-page .nymble-logo-center {
  height: 146px;
  max-width: 340px;
}

body.completion-page .brand-plus {
  font-size: 54px;
}

body.completion-page .customer-logo {
  height: 76px;
  max-width: 260px;
}

body.completion-page .customer-name {
  font-size: 40px;
}

body.completion-page.wellster-lockup-mode .brand {
  max-width: 820px;
  margin: 0 auto;
}

body.completion-page.wellster-lockup-mode .wellster-lockup {
  max-width: 820px;
}

body.completion-page.wellster-lockup-mode .wellster-lockup-image {
  max-width: 780px;
}

.completion-wrap {
  min-height: calc(100vh - 220px);
  display: grid;
  place-items: center;
}

.completion-card {
  text-align: center;
  width: 100%;
  padding: 0;
}

body.completion-page .success-title {
  font-family: "Filson Pro", var(--font-body);
  font-size: clamp(44px, 6vw, 76px);
  line-height: 1.05;
  color: var(--accent);
}

body.completion-page .success-text {
  font-size: 24px;
  margin-top: 18px;
  color: var(--accent);
  line-height: 1.45;
}

.completion-actions {
  display: flex;
  justify-content: center;
  margin-top: 34px;
}

.completion-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 22px;
  width: min(320px, 100%);
  border-radius: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(237, 169, 79, 0.35);
  color: var(--text);
  font-size: 18px;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
}

.completion-button:hover {
  text-decoration: none;
  background: rgba(237, 169, 79, 0.45);
}

.completion-button:focus-visible {
  outline: 2px solid rgba(237, 169, 79, 0.55);
  outline-offset: 2px;
}

form {
  display: grid;
  gap: 24px;
  max-width: var(--form-max);
  margin: 0 auto;
}

.phone-row {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  background: transparent;
}

.country-select-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.country-select-wrap::after {
  content: "▾";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
  font-size: 12px;
}

.country-select {
  border: none;
  border-right: 1px solid var(--border);
  background: transparent;
  padding: 0 28px 0 10px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  min-width: 98px;
  font-family: inherit;
  color: inherit;
  text-align: left;
}

.dial-prefix {
  display: flex;
  align-items: center;
  padding: 0 0 0 12px;
  font-size: 18px;
  color: var(--muted);
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
}

.phone-row input {
  border: none !important;
  border-radius: 0 !important;
  flex: 1;
  min-width: 0;
  padding: 13px 12px 13px 6px;
}

.phone-row:focus-within {
  outline: 2px solid rgba(237, 169, 79, 0.5);
  outline-offset: 1px;
}

.phone-resolved {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  opacity: 0.7;
}

.field label {
  display: block;
  font-weight: 400;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 12px;
}

.field input,
.field select:not(.country-select) {
  width: 100%;
  font-size: 18px;
  padding: 13px 12px;
  border-radius: 0;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.field input[readonly],
.field select:disabled {
  background: transparent;
  color: var(--text);
}

.field .hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text);
}

.inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.disclaimer {
  margin: 10px 0 0;
  padding-left: 16px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

.actions {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

button.primary {
  appearance: none;
  border: none;
  border-radius: 0;
  padding: 12px 18px;
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
  background: var(--accent);
  cursor: pointer;
  width: 100%;
  max-width: var(--form-max);
  height: 50px;
}

button.primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.country-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.country-modal-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}

.country-modal-card {
  position: fixed;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.country-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.country-modal-title {
  font-weight: 400;
  font-size: 14px;
  color: var(--text);
}

.country-modal-close {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--text);
  padding: 2px 6px;
}

.country-modal-search {
  margin: 10px 12px;
  width: calc(100% - 24px);
  border: 1px solid var(--border);
  background: transparent;
  padding: 10px 12px;
  border-radius: 0;
  font-size: 14px;
}

.country-modal-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.country-option {
  appearance: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.country-option:hover,
.country-option:focus-visible {
  background: rgba(237, 169, 79, 0.14);
  outline: none;
}

.country-option.selected {
  background: rgba(237, 169, 79, 0.22);
  font-weight: 400;
}

.footer {
  padding-top: 6px;
  padding-bottom: 34px;
  color: var(--text);
  text-align: center;
  font-size: 14px;
}

.success-title {
  margin: 0;
  font-size: 22px;
  color: var(--text);
  font-weight: 400;
}

.success-text {
  margin: 10px 0 0;
  color: var(--text);
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
h5,
h6,
b,
strong {
  font-weight: 400;
  color: var(--text);
}

@media (max-width: 480px) {
  .wrap {
    padding: 26px 18px;
  }

  .brand {
    column-gap: 24px;
    max-width: 520px;
  }

  body.wellster-lockup-mode .brand {
    max-width: 520px;
  }

  .wellster-lockup {
    max-width: 100%;
  }

  .wellster-lockup-image {
    max-width: 420px;
  }

  .nymble-logo-img {
    height: 90px;
    max-width: 260px;
  }

  .nymble-logo-center {
    height: 160px;
  }

  .brand-plus {
    font-size: 56px;
  }

  .customer-logo {
    height: 70px;
  }

  .customer-name {
    font-size: 34px;
    max-width: 240px;
  }

  body.shift-brand-mode .customer-name {
    font-size: 40px;
    max-width: 170px;
  }

  body.demo-mode #nymble-center-logo {
    height: 98px;
    max-width: 98px;
  }

  body.demo-mode .form-title {
    font-size: 28px;
  }

  body.demo-mode .description {
    font-size: 13px;
    margin: 16px auto 18px;
  }

  body.completion-page .success-text {
    font-size: 18px;
  }

  .completion-wrap {
    min-height: calc(100vh - 190px);
  }

  body.completion-page.wellster-lockup-mode .brand {
    max-width: 520px;
  }

  body.completion-page.wellster-lockup-mode .wellster-lockup-image {
    max-width: 460px;
  }

  form {
    gap: 16px;
  }

  .field label {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .dial-prefix {
    font-size: 16px;
    padding-left: 10px;
  }

  .field input,
  .field select:not(.country-select),
  .phone-row input {
    font-size: 16px;
    padding: 10px 11px 10px 6px;
  }

  .disclaimer {
    font-size: 13px;
    line-height: 1.5;
  }

  button.primary {
    font-size: 16px;
    height: 44px;
  }
}
