:root {
  --page-bg: #ffffff;
  --text: #171717;
  --muted: #6f6f6f;
  --hairline: #d3d3d3;
  --dot: rgba(23, 23, 23, 0.14);
  --switch-track: #e6e6e6;
  --switch-thumb: #111111;
  --error: #8b2f2f;
  --field-bg: rgba(255, 255, 255, 0.78);

  --page-pad-x: clamp(24px, 3.2vw, 58px);
  --page-pad-y: clamp(24px, 3.2vw, 48px);
  --content-width: 94vw;
  --header-height: 66px;
  --transition: 180ms ease;
}

html[data-theme="dark"] {
  --page-bg: #000000;
  --text: #f1f1f1;
  --muted: #9a9a9a;
  --hairline: #343434;
  --dot: rgba(255, 255, 255, 0.12);
  --switch-track: #252525;
  --switch-thumb: #f3f3f3;
  --error: #e29393;
  --field-bg: rgba(0, 0, 0, 0.72);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  transition: background-color var(--transition), color var(--transition);
}

button, input { font: inherit; }

.review-shell {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--page-pad-y) var(--page-pad-x) 30px;
}

.site-header {
  min-height: var(--header-height);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 2;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  min-height: 34px;
}

.brand-logo {
  display: block;
  width: clamp(190px, 15vw, 280px);
  height: auto;
  max-height: 42px;
}


.brand-logo--dark { display: none; }
html[data-theme="dark"] .brand-logo--light { display: none; }
html[data-theme="dark"] .brand-logo--dark { display: block; }

.theme-control {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  padding-top: 2px;
}

.theme-label {
  font-size: clamp(18px, 1.5vw, 29px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.theme-switch {
  width: 33px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  padding: 2px;
  background: var(--switch-track);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: background-color var(--transition);
}

.theme-switch__thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--switch-thumb);
  transform: translateX(0);
  transition: transform var(--transition), background-color var(--transition);
}

html[data-theme="dark"] .theme-switch__thumb {
  transform: translateX(15px);
}

.review-stage {
  width: 100%;
  min-height: 0;
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.review-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: clamp(26px, 5vh, 72px) 0 clamp(18px, 4vh, 52px);
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.15px);
  background-size: 19px 19px;
  transition: background-image var(--transition);
}

.code-form {
  width: min(590px, 72vw);
  transform: translateY(-1vh);
}

.code-field-wrap {
  position: relative;
}

.code-field {
  width: 100%;
  height: 82px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--field-bg);
  color: var(--text);
  text-align: center;
  font-size: clamp(19px, 1.45vw, 28px);
  font-weight: 400;
  letter-spacing: -0.02em;
  outline: none;
  padding: 0 72px;
  caret-color: var(--text);
  transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition), color var(--transition);
}

.code-field::placeholder {
  color: var(--text);
  opacity: 0.86;
}

.code-field:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent);
}

.submit-arrow {
  position: absolute;
  top: 50%;
  right: 22px;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 25px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

.code-field:not(:placeholder-shown) + .submit-arrow {
  opacity: 0.88;
  pointer-events: auto;
}

.submit-arrow:hover { transform: translateY(-50%) translateX(3px); }

.code-status {
  min-height: 22px;
  margin: 11px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.code-status.is-error { color: var(--error); }

.site-footer {
  align-self: end;
  font-size: clamp(9px, 0.7vw, 12px);
  color: var(--muted);
  letter-spacing: -0.01em;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 720px) {
  .review-shell {
    padding: 24px 20px 24px;
  }

  .brand-logo { width: 162px; }

  .theme-label { font-size: 16px; }

  .theme-control { gap: 9px; }

  .review-stage::before {
    inset: 28px 0;
    background-size: 17px 17px;
  }

  .code-form { width: min(92vw, 520px); }

  .code-field {
    height: 68px;
    padding: 0 60px;
    font-size: 18px;
  }

  .submit-arrow { right: 14px; }

  .site-footer { font-size: 9px; }
}

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