:root {
  color-scheme: light;
  --so-ink: #30363a;
  --so-muted: #697278;
  --so-orange: #d96d2b;
  --so-orange-dark: #a94c19;
  --so-orange-pale: #fff0e5;
  --so-paper: #fbf8f3;
  --so-white: #fffdfa;
  --so-line: #e2ddd5;
  --so-green: #466b57;
  --so-danger: #a33d32;
  --so-shadow: 0 18px 48px rgba(52, 44, 35, 0.08);
  --so-display: "Avenir Next", "Segoe UI", sans-serif;
  --so-body: "Aptos", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--so-paper);
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--so-ink);
  background:
    radial-gradient(ellipse at 90% -8%, rgba(217, 109, 43, 0.10), transparent 34rem),
    var(--so-paper);
  font-family: var(--so-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(217, 109, 43, 0.32);
  outline-offset: 3px;
}

.so-shell {
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
  padding: 24px 0 56px;
}

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

.so-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.so-brand img {
  display: block;
  width: min(224px, 52vw);
  height: auto;
  max-height: 66px;
  object-fit: contain;
  object-position: left center;
}

.so-secure-note {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--so-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.so-secure-mark {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid #e8c8b2;
  border-radius: 50%;
  color: var(--so-orange-dark);
  background: var(--so-orange-pale);
}

.so-secure-mark svg {
  width: 13px;
  height: 13px;
}

.so-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
  padding: 32px 0 30px;
  border-top: 1px solid var(--so-line);
  border-bottom: 1px solid var(--so-line);
}

.so-kicker {
  margin: 0 0 10px;
  color: var(--so-orange-dark);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.so-intro h1,
.so-state h1 {
  max-width: 720px;
  margin: 0;
  font-family: var(--so-display);
  font-size: clamp(2rem, 5vw, 3.45rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.so-intro-copy {
  max-width: 560px;
  margin: 14px 0 0;
  color: var(--so-muted);
  font-size: 1rem;
}

.so-expiry {
  align-self: center;
  min-width: 164px;
  padding: 14px 16px;
  border-left: 2px solid var(--so-orange);
  background: rgba(255, 253, 250, 0.66);
}

.so-expiry span {
  display: block;
  color: var(--so-muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.so-expiry strong {
  display: block;
  margin-top: 3px;
  font-family: var(--so-display);
  font-size: 1.06rem;
}

.so-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 32px;
  padding-top: 30px;
}

.so-form {
  min-width: 0;
}

.so-section {
  margin: 0 0 30px;
}

.so-section-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 15px;
}

.so-section-number {
  color: var(--so-orange);
  font-family: var(--so-display);
  font-size: 0.85rem;
  font-weight: 800;
}

.so-section-heading h2 {
  margin: 0;
  font-family: var(--so-display);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

.so-section-caption {
  margin: -7px 0 15px 29px;
  color: var(--so-muted);
  font-size: 0.88rem;
}

.so-quote-chip {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 3px 9px;
  border: 1px solid #f0d0ba;
  border-radius: 999px;
  color: var(--so-orange-dark);
  background: var(--so-orange-pale);
  font-size: 0.76rem;
  font-weight: 700;
}

.so-service-list {
  display: grid;
  gap: 10px;
}

.so-service-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(104px, auto);
  gap: 14px;
  align-items: start;
  padding: 18px 18px 16px;
  border: 1px solid var(--so-line);
  border-radius: 12px;
  background: var(--so-white);
  box-shadow: 0 2px 8px rgba(48, 54, 58, 0.025);
  transition: transform 180ms ease, opacity 180ms ease;
}

.so-service-card:has(.so-service-toggle:checked) {
  border-color: #e9a77d;
  box-shadow: 0 7px 22px rgba(169, 76, 25, 0.09);
}

.so-service-card:hover {
  transform: translateY(-1px);
}

.so-service-card.is-unavailable {
  background: #f4f1eb;
}

.so-service-toggle {
  width: 21px;
  height: 21px;
  margin: 2px 0 0;
  accent-color: var(--so-orange-dark);
  cursor: pointer;
}

.so-service-toggle:disabled {
  cursor: not-allowed;
}

.so-service-copy {
  min-width: 0;
}

.so-service-titleline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.so-service-title {
  font-family: var(--so-display);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
}

.so-service-description {
  margin: 4px 0 0;
  color: var(--so-muted);
  font-size: 0.87rem;
  line-height: 1.48;
}

.so-service-unavailable {
  margin: 8px 0 0;
  color: var(--so-danger);
  font-size: 0.82rem;
  font-weight: 600;
}

.so-service-unavailable a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.so-service-side {
  display: grid;
  justify-items: end;
  gap: 11px;
  text-align: right;
}

.so-rate {
  color: var(--so-ink);
  font-family: var(--so-display);
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
}

.so-rate small {
  display: block;
  color: var(--so-muted);
  font-family: var(--so-body);
  font-size: 0.72rem;
  font-weight: 500;
}

.so-quantity {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--so-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.so-quantity input {
  width: 66px;
  height: 40px;
  padding: 0 8px;
  border: 1px solid #d4cec5;
  border-radius: 8px;
  color: var(--so-ink);
  background: #fff;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.so-quantity input:disabled {
  color: #98938d;
  background: #f1eee9;
}

.so-summary {
  position: sticky;
  top: 20px;
  padding: 21px;
  border: 1px solid #e8c8b2;
  border-radius: 14px;
  background: #fff9f3;
  box-shadow: var(--so-shadow);
}

.so-summary h2 {
  margin: 0;
  font-family: var(--so-display);
  font-size: 1.18rem;
  letter-spacing: -0.03em;
}

.so-summary-intro {
  margin: 5px 0 18px;
  color: var(--so-muted);
  font-size: 0.83rem;
}

.so-totals {
  display: grid;
  gap: 9px;
  padding: 15px 0;
  border-top: 1px solid #edd9ca;
  border-bottom: 1px solid #edd9ca;
}

.so-total-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--so-muted);
  font-size: 0.88rem;
}

.so-total-line strong {
  color: var(--so-ink);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.so-total-line.is-grand {
  align-items: baseline;
  margin-top: 2px;
  color: var(--so-ink);
  font-size: 1rem;
  font-weight: 700;
}

.so-total-line.is-grand strong {
  color: var(--so-orange-dark);
  font-family: var(--so-display);
  font-size: 1.35rem;
  font-weight: 800;
}

.so-status {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--so-muted);
  font-size: 0.78rem;
}

.so-status[data-kind="error"] {
  color: var(--so-danger);
  font-weight: 600;
}

.so-status[data-kind="success"] {
  color: var(--so-green);
}

.so-primary-button,
.so-secondary-button,
.so-retry-button {
  display: inline-flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, opacity 160ms ease;
}

.so-primary-button {
  margin-top: 10px;
  border: 1px solid var(--so-orange-dark);
  color: #fffaf5;
  background: var(--so-orange-dark);
  box-shadow: 0 5px 12px rgba(169, 76, 25, 0.17);
}

.so-primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #913e12;
}

.so-primary-button:disabled {
  border-color: #c8b9ac;
  color: #fff;
  background: #b8a99d;
  box-shadow: none;
  cursor: not-allowed;
}

.so-button-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.so-secondary-button {
  min-height: 46px;
  margin-top: 10px;
  border: 1px solid #d9c8b9;
  color: var(--so-ink);
  background: transparent;
  font-size: 0.86rem;
}

.so-secondary-button:hover:not(:disabled) {
  border-color: var(--so-orange);
  background: rgba(255, 255, 255, 0.76);
}

.so-secondary-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.so-summary-help {
  margin: 15px 0 0;
  color: var(--so-muted);
  font-size: 0.77rem;
  line-height: 1.5;
}

.so-fields-groups {
  display: grid;
  gap: 22px;
}

.so-fields-group {
  padding: 18px;
  border: 1px solid var(--so-line);
  border-radius: 12px;
  background: rgba(255, 253, 250, 0.78);
}

.so-fields-group h3 {
  margin: 0 0 14px;
  color: var(--so-orange-dark);
  font-family: var(--so-display);
  font-size: 0.96rem;
  font-weight: 800;
}

.so-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.so-field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.so-field label {
  color: #596168;
  font-size: 0.8rem;
  font-weight: 600;
}

.so-field input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d8d2ca;
  border-radius: 7px;
  color: var(--so-ink);
  background: var(--so-white);
  transition: opacity 150ms ease;
}

.so-field input:hover {
  border-color: #b9a99b;
}

.so-field input:read-only {
  color: #686d70;
  background: #f1eee9;
  cursor: default;
}

.so-field input:focus {
  border-color: var(--so-orange);
  box-shadow: 0 0 0 3px rgba(217, 109, 43, 0.1);
  outline: none;
}

.so-legal-note {
  display: grid;
  grid-template-columns: 21px 1fr;
  gap: 11px;
  margin-top: 20px;
  padding: 15px;
  border-radius: 10px;
  color: #596168;
  background: #f0ede6;
  font-size: 0.82rem;
}

.so-legal-note svg {
  width: 18px;
  height: 18px;
  color: var(--so-orange-dark);
}

.so-legal-note p {
  margin: 0;
}

.so-signing {
  margin-top: 30px;
  padding: 23px;
  border: 1px solid #e8c8b2;
  border-radius: 13px;
  background: #fff9f3;
}

.so-signing .so-section-caption {
  margin-bottom: 20px;
}

.so-supplier-signature {
  display: flex;
  min-height: 102px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 22px;
  padding: 14px 17px;
  border: 1px solid var(--so-line);
  border-radius: 9px;
  background: var(--so-white);
}

.so-supplier-signature > div {
  display: grid;
  gap: 2px;
}

.so-signature-label {
  color: var(--so-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.so-supplier-signature strong {
  font-family: var(--so-display);
}

.so-supplier-signature > div > span:last-child {
  color: var(--so-muted);
  font-size: 0.84rem;
}

.so-supplier-signature img {
  display: block;
  width: min(190px, 42%);
  height: 62px;
  object-fit: contain;
  object-position: right center;
}

.so-signature-customer {
  display: grid;
  gap: 8px;
}

.so-signature-customer > label,
.so-signer-field > label {
  color: #596168;
  font-size: 0.83rem;
  font-weight: 700;
}

#so-customer-signature {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 7 / 2;
  border: 1px solid #d8d2ca;
  border-radius: 8px;
  background:
    linear-gradient(to bottom, transparent calc(100% - 27px), rgba(217, 109, 43, 0.16) calc(100% - 27px), rgba(217, 109, 43, 0.16) calc(100% - 26px), transparent calc(100% - 26px)),
    var(--so-white);
  cursor: crosshair;
  touch-action: none;
}

.so-signature-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--so-muted);
  font-size: 0.78rem;
}

.so-text-button {
  padding: 0;
  border: 0;
  color: var(--so-orange-dark);
  background: transparent;
  cursor: pointer;
  font-size: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.so-text-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.so-signer-field {
  margin-top: 20px;
}

.so-consent {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 11px;
  margin-top: 18px;
  padding: 15px;
  border: 1px solid #e8c8b2;
  border-radius: 9px;
  background: var(--so-white);
  font-size: 0.84rem;
  line-height: 1.5;
}

.so-consent input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--so-orange-dark);
}

.so-signing-disclaimer {
  margin: 13px 0 0;
  color: var(--so-muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.so-accept-button {
  margin-top: 10px;
}

[hidden] {
  display: none !important;
}

.so-access-wrap {
  display: grid;
  min-height: min(66dvh, 620px);
  place-items: center;
  padding: 8px 0 24px;
}

.so-access-card {
  width: min(100%, 520px);
  padding: clamp(25px, 6vw, 42px);
  border: 1px solid var(--so-line);
  border-radius: 16px;
  background: var(--so-white);
  box-shadow: var(--so-shadow);
  text-align: center;
}

.so-access-card .so-state-mark {
  margin-bottom: 19px;
}

.so-access-card h1 {
  margin: 0;
  font-family: var(--so-display);
  font-size: clamp(1.8rem, 5vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.so-access-copy {
  max-width: 390px;
  margin: 14px auto 20px;
  color: var(--so-muted);
}

.so-access-copy strong {
  color: var(--so-ink);
  overflow-wrap: anywhere;
}

.so-access-card .so-primary-button {
  width: 100%;
  margin: 0;
}

.so-access-verify {
  display: grid;
  gap: 9px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--so-line);
  text-align: left;
}

.so-access-verify label,
.so-email-change label {
  color: #596168;
  font-size: 0.8rem;
  font-weight: 700;
}

.so-access-verify input,
.so-email-change input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #d8d2ca;
  border-radius: 7px;
  color: var(--so-ink);
  background: var(--so-white);
}

.so-access-verify input {
  text-align: center;
  font-size: 1.18rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.28em;
}

.so-access-verify .so-primary-button {
  margin-top: 4px;
}

.so-access-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--so-muted);
  font-size: 0.82rem;
}

.so-access-status[data-kind="error"],
.so-email-change-status[data-kind="error"] {
  color: var(--so-danger);
  font-weight: 600;
}

.so-access-status[data-kind="success"],
.so-email-change-status[data-kind="success"] {
  color: var(--so-green);
}

.so-email-change {
  margin-top: 19px;
  padding-top: 14px;
  border-top: 1px solid #edd9ca;
}

.so-email-change summary {
  color: var(--so-orange-dark);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.so-email-change > p:not(.so-email-change-status) {
  margin: 10px 0;
  color: var(--so-muted);
  font-size: 0.78rem;
}

.so-email-change label {
  display: block;
  margin: 11px 0 5px;
  text-align: left;
}

.so-email-change input {
  min-height: 42px;
  font-size: 0.85rem;
}

.so-email-change .so-secondary-button {
  min-height: 40px;
  padding: 7px 10px;
  font-size: 0.78rem;
}

.so-email-change .so-reload-quote {
  border-color: var(--so-green);
  color: var(--so-green);
}

.so-email-change-status {
  margin: 8px 0 0;
  color: var(--so-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.so-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 30px;
  padding-top: 17px;
  border-top: 1px solid var(--so-line);
  color: var(--so-muted);
  font-size: 0.76rem;
}

.so-footer strong {
  color: var(--so-ink);
}

.so-state-wrap {
  display: grid;
  min-height: min(70dvh, 640px);
  place-items: center;
}

.so-state {
  width: min(100%, 560px);
  padding: 36px;
  border: 1px solid var(--so-line);
  border-radius: 16px;
  background: var(--so-white);
  box-shadow: var(--so-shadow);
  text-align: center;
}

.so-state-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  color: var(--so-orange-dark);
  background: var(--so-orange-pale);
}

.so-state-mark svg {
  width: 27px;
  height: 27px;
}

.so-state h1 {
  font-size: clamp(1.8rem, 5vw, 2.45rem);
}

.so-state p {
  margin: 13px 0 0;
  color: var(--so-muted);
}

.so-retry-button {
  width: auto;
  min-width: 176px;
  margin: 23px auto 0;
  padding: 0 20px;
  border: 1px solid var(--so-orange-dark);
  color: #fffaf5;
  background: var(--so-orange-dark);
}

.so-retry-button:hover {
  transform: translateY(-1px);
  background: #913e12;
}

.so-loading {
  display: grid;
  gap: 14px;
  padding-top: 26px;
}

.so-skeleton {
  overflow: hidden;
  height: 76px;
  border-radius: 12px;
  background: linear-gradient(90deg, #eee9e1 20%, #f8f4ee 42%, #eee9e1 64%);
  background-size: 240% 100%;
  animation: so-pulse 1.25s ease-in-out infinite alternate;
}

.so-skeleton.is-short {
  width: 62%;
  height: 44px;
}

.so-visually-hidden {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.so-fade-in {
  animation: so-rise 420ms both;
}

@keyframes so-pulse {
  from { opacity: 0.58; }
  to { opacity: 1; }
}

@keyframes so-rise {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .so-shell {
    width: min(100% - 28px, 600px);
    padding-top: 16px;
  }

  .so-topbar {
    margin-bottom: 24px;
  }

  .so-brand img {
    width: min(190px, 49vw);
  }

  .so-secure-note {
    gap: 6px;
    font-size: 0.69rem;
  }

  .so-secure-mark {
    width: 23px;
    height: 23px;
  }

  .so-intro {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 25px 0 22px;
  }

  .so-expiry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    padding: 9px 12px;
    border-left-width: 2px;
  }

  .so-expiry strong {
    margin: 0;
  }

  .so-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding-top: 24px;
  }

  .so-summary {
    position: static;
    grid-row: 1;
    padding: 18px;
  }

  .so-form {
    display: contents;
  }

  .so-section--services {
    grid-row: 2;
  }

  .so-section--fields {
    grid-row: 3;
  }

  .so-service-card {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 15px 12px;
  }

  .so-service-side {
    gap: 8px;
  }

  .so-service-title {
    font-size: 0.96rem;
  }

  .so-service-description {
    font-size: 0.81rem;
  }
}

@media (max-width: 430px) {
  .so-shell {
    width: min(100% - 24px, 400px);
  }

  .so-secure-note span:last-child {
    max-width: 78px;
    white-space: normal;
    line-height: 1.2;
  }

  .so-intro h1 {
    font-size: clamp(1.95rem, 9vw, 2.5rem);
  }

  .so-section-heading {
    gap: 9px;
  }

  .so-section-heading h2 {
    font-size: 1.1rem;
  }

  .so-service-card {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .so-service-side {
    grid-column: 2;
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
    text-align: left;
  }

  .so-rate small {
    display: inline;
    margin-left: 4px;
  }

  .so-quantity {
    flex-direction: row;
  }

  .so-quantity input {
    width: 58px;
  }

  .so-fields-group {
    padding: 15px 12px;
  }

  .so-fields-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .so-signing {
    padding: 17px 13px;
  }

  .so-signature-controls {
    align-items: flex-start;
  }

  .so-supplier-signature {
    padding: 12px;
  }

  .so-footer {
    flex-direction: column;
    gap: 5px;
  }

  .so-state {
    padding: 29px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
