:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18201b;
  background: #f7faf5;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background:
    linear-gradient(rgba(38, 93, 66, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 93, 66, .035) 1px, transparent 1px),
    radial-gradient(circle at 78% 20%, rgba(191, 216, 194, .46), transparent 31rem),
    linear-gradient(135deg, #fcfcf8 0%, #f8faf4 48%, #eef5ed 100%);
  background-size: 48px 48px, 48px 48px, auto, auto;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.legal-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(20px, 2.4vw, 36px) clamp(18px, 4vw, 64px) clamp(36px, 5vw, 76px);
}

.legal-shell::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 360px 220px at 0 0, rgba(255, 255, 255, .99), rgba(255, 255, 255, 0) 78%);
  content: "";
}

.legal-brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.legal-brand img { display: block; width: clamp(150px, 12vw, 210px); height: auto; }
.screen-actions { min-height: 42px; }
.screen-actions .button { border: 1px solid #cfd8d1; border-radius: 10px; background: rgba(255,255,255,.86); padding: 9px 13px; color: #405047; font-weight: 700; cursor: pointer; }
.screen-actions .button:hover { background: #fff; border-color: #9cac9f; }

.legal-stage {
  display: flex;
  width: min(100%, 900px);
  margin: clamp(28px, 4.5vh, 56px) auto 0;
  flex-direction: column;
  align-items: center;
}

.legal-app-icon { width: 76px; height: 76px; margin-bottom: 20px; border-radius: 22%; filter: drop-shadow(0 10px 16px rgba(20, 61, 53, .14)); }

.legal-card {
  width: 100%;
  border: 1px solid rgba(109, 137, 112, .3);
  border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 50px rgba(20, 38, 27, .09);
  padding: clamp(24px, 4vw, 44px);
}

.legal-status-card, .legal-error { max-width: 600px; text-align: center; }
.legal-error { border-color: #e5b7b7; background: rgba(255, 249, 249, .96); }
.legal-eyebrow { margin: 0 0 7px; color: #26704b; font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.legal-heading h1, .legal-status-card h1, .legal-error h1, .legal-document-heading h1 { margin: 0; color: #18201b; font-size: clamp(27px, 4vw, 38px); line-height: 1.15; letter-spacing: -.025em; }
.legal-heading h1 { font-size: clamp(26px, 3.6vw, 35px); }
.legal-heading > p:last-child, .legal-status-card > p:last-child, .legal-error > p { margin: 10px 0 0; color: #526058; line-height: 1.6; }

.legal-document-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.legal-document-button { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; border: 1px solid #d7e1d9; border-radius: 14px; background: #fbfdfb; padding: 17px 18px; color: #18201b; text-align: left; cursor: pointer; }
.legal-document-button:hover { border-color: #8fb49b; background: #f5faf6; }
.legal-document-button:disabled { cursor: wait; opacity: .65; }
.legal-document-title { display: block; font-weight: 800; }
.legal-document-version { display: block; margin-top: 3px; color: #647168; font-size: 13px; }
.legal-document-arrow { color: #26704b; font-size: 20px; }

.legal-provider { margin-top: 24px; border-top: 1px solid #e3e9e4; padding-top: 19px; color: #526058; font-size: 14px; line-height: 1.55; }
.legal-provider h2 { margin: 0 0 7px; color: #263129; font-size: 15px; }
.legal-provider p { margin: 3px 0; }
.legal-provider a { color: #1f6845; font-weight: 700; }

.legal-acceptance { margin-top: 26px; border: 1px solid #c9ddd0; border-radius: 16px; background: #f7fbf8; padding: 20px; }
.legal-confirmation { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; color: #263129; font-weight: 650; line-height: 1.55; cursor: pointer; }
.legal-confirmation input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: #26704b; }
.legal-message { min-height: 1.45em; margin: 12px 0 0 34px; color: #a23b3b; font-size: 14px; }

.legal-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 11px; padding: 10px 17px; font-weight: 800; text-decoration: none; cursor: pointer; }
.legal-button-primary { margin-top: 14px; border: 1px solid #1f6744; background: #26704b; color: #fff; }
.legal-button-primary:hover:not(:disabled) { background: #1f5e40; }
.legal-button-primary:disabled { border-color: #b8c3ba; background: #c5cec7; cursor: not-allowed; }
.legal-button-secondary { margin-top: 20px; border: 1px solid #b9c7bc; background: #fff; color: #263129; }

.legal-member-notice { margin-top: 26px; border: 1px solid #decf9f; border-radius: 16px; background: #fffaf0; padding: 20px; }
.legal-member-notice h2 { margin: 0; font-size: 18px; }
.legal-member-notice p { margin: 8px 0 0; color: #5c5747; line-height: 1.55; }
.legal-accepted-actions { margin-top: 26px; border-top: 1px solid #e3e9e4; padding-top: 18px; }
.legal-accepted-actions p { margin: 0; color: #526058; }

.legal-back { align-self: flex-start; border: 0; background: transparent; padding: 0; color: #1f6845; font-weight: 800; cursor: pointer; }
.legal-document-heading { margin-top: 27px; border-bottom: 1px solid #e3e9e4; padding-bottom: 22px; }
.legal-document-meta { margin: 9px 0 0; color: #647168; font-weight: 650; }
.legal-document-body { color: #303a33; font-family: Georgia, "Times New Roman", serif; font-size: 16px; line-height: 1.72; }
.legal-document-body h2, .legal-document-body h3, .legal-document-body h4 { color: #18201b; font-family: Inter, ui-sans-serif, system-ui, sans-serif; line-height: 1.3; }
.legal-document-body h2 { margin: 34px 0 10px; font-size: 23px; }
.legal-document-body h3 { margin: 26px 0 8px; font-size: 19px; }
.legal-document-body h4 { margin: 22px 0 7px; font-size: 17px; }
.legal-document-body p { margin: 13px 0; white-space: pre-line; }
.legal-document-body ul, .legal-document-body ol { margin: 12px 0; padding-left: 27px; }
.legal-document-body li { margin: 7px 0; }
.legal-table-wrap { max-width: 100%; margin: 18px 0; overflow-x: auto; }
.legal-document-body table { width: 100%; border-collapse: collapse; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 14px; line-height: 1.5; }
.legal-document-body th, .legal-document-body td { border: 1px solid #d9e1da; padding: 11px 12px; text-align: left; vertical-align: top; white-space: pre-line; }
.legal-document-body th { width: 28%; background: #f5f8f5; color: #263129; }

@media (min-width: 681px) {
  .legal-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .legal-brand-bar,
  .legal-stage {
    grid-column: 1;
    grid-row: 1;
  }

  .legal-brand-bar { align-self: start; }

  .legal-stage {
    align-self: start;
    margin: clamp(6px, 1.2vh, 14px) auto 0;
  }

  .legal-viewer {
    display: flex;
    flex-direction: column;
    max-height: min(78vh, 860px);
    max-height: min(78svh, 860px);
  }

  .legal-document-body {
    min-height: 0;
    margin-top: 24px;
    overflow-y: auto;
    padding-right: 14px;
  }
}

button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(38, 112, 75, .25); outline-offset: 3px; }

@media (max-width: 680px) {
  body { background-size: 42px 42px, 42px 42px, auto, auto; }
  .legal-shell { padding: 20px 14px 34px; }
  .legal-brand-bar { align-items: flex-start; }
  .legal-brand img { width: 158px; }
  .legal-stage { margin-top: 38px; }
  .legal-app-icon { width: 64px; height: 64px; }
  .legal-card { border-radius: 17px; padding: 22px 17px; }
  .legal-document-list { grid-template-columns: 1fr; }
  .legal-confirmation { grid-template-columns: 21px 1fr; gap: 10px; }
  .legal-message { margin-left: 31px; }
  .legal-button-primary { width: 100%; }
  .legal-document-body th { width: 36%; }
}

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