:root {
  color-scheme: dark;
  --bg: #111214;
  --panel: #2a2927;
  --gold: #dfbe81;
  --text: #f3eee3;
  --muted: #bbb6ad;
  --line: #ffffff24;
  --ink: #211a0e;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #0c0d0f;
  color: var(--text);
  min-width: 320px;
  font-size: 16px;
  line-height: 1.5;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
[hidden] {
  display: none !important;
}
a {
  color: var(--gold);
  text-underline-offset: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #ffe0a3;
  outline-offset: 4px;
}
.phone-shell {
  max-width: 520px;
  min-height: 100svh;
  margin: auto;
  padding: 32px 22px calc(20px + env(safe-area-inset-bottom));
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 110% 8%, #95816642 0, transparent 33%),
    linear-gradient(145deg, #1e2022 0, #111214 31%, #26231e 67%, #121315 100%);
}
.phone-shell:before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 440px;
  height: 440px;
  top: -240px;
  right: -210px;
  border-radius: 50%;
  border: 1px solid #ecd4a4a1;
  box-shadow:
    inset 10px -9px 30px #ead3a33d,
    0 2px 3px #e4c78c55,
    0 13px 45px #0009;
  background: radial-gradient(ellipse at 15% 80%, #b39c7155, transparent 40%);
}
.phone-shell:after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 120px -300px -200px;
  transform: rotate(-28deg);
  background: linear-gradient(
    90deg,
    transparent 32%,
    #c4ad7715 36%,
    transparent 40%,
    #efd29c17 65%,
    transparent 70%
  );
  pointer-events: none;
}
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.brand {
  width: 222px;
  height: 43px;
  background: url("/assets/brand-source.png") -30px -25px / 750px 434px
    no-repeat;
  flex-shrink: 0;
}
.year {
  color: var(--gold);
  font-size: 17px;
}
.hero {
  padding: 39px 7px 24px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gold);
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: 38px;
  letter-spacing: -0.035em;
  font-weight: 650;
  line-height: 1.2;
  margin: 8px 0 12px;
}
h2 {
  font-size: 24px;
  font-weight: 600;
}
.hero p,
.success-hero p {
  color: #d5d0c8;
  font-size: 15px;
}
.glass {
  padding: 26px 22px;
  border: 1px solid #d6c39d66;
  border-radius: 27px;
  background: linear-gradient(140deg, #4b4840c9, #232426ed 54%, #36322bde);
  box-shadow:
    inset 0 1px 1px #fff5,
    inset 1px 0 1px #edce9422,
    0 16px 45px #0004;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
fieldset {
  margin: 0;
  border: 0;
  padding: 0;
  min-width: 0;
}
.field {
  margin-bottom: 21px;
}
.field > label,
legend {
  font-size: 15px;
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}
.required {
  color: #e3b3a5;
  font-size: 13px;
  margin-left: 3px;
}
.optional {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
}
input:not([type="radio"], [type="checkbox"], [type="range"]),
select {
  width: 100%;
  min-height: 49px;
  color: var(--text);
  background: #ffffff08;
  border: 1px solid #ffffff35;
  border-radius: 12px;
  padding: 11px 14px;
  box-shadow: inset 0 1px 6px #0001;
}
input::placeholder {
  color: #b5b1ab;
  font-size: 14px;
}
select {
  appearance: auto;
}
select option {
  background: #242424;
}
input:focus,
select:focus {
  border-color: var(--gold);
}
.segments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.segments label {
  position: relative;
}
.segments input {
  position: absolute;
  opacity: 0;
}
.segments span {
  display: grid;
  place-items: center;
  min-height: 47px;
  border: 1px solid #ffffff30;
  border-radius: 24px;
  background: #ffffff05;
}
.segments input:checked + span {
  background: linear-gradient(125deg, #f4d99e, #bc9859);
  color: var(--ink);
  border-color: #f2d39a;
  font-weight: 600;
}
.segments input:focus-visible + span {
  outline: 3px solid #ffe0a3;
  outline-offset: 3px;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.6;
}
.upload {
  width: 100%;
  min-height: 137px;
  border: 1px solid #c4aa7655;
  border-radius: 17px;
  background: linear-gradient(130deg, #a28d6415, #0001);
  color: var(--gold);
  padding: 17px;
  display: grid;
  place-items: center;
}
.upload strong {
  display: block;
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
  margin: 7px 0 2px;
}
.upload small {
  color: var(--muted);
  font-size: 12px;
}
.upload svg {
  display: block;
  margin: auto;
}
.upload img {
  height: 156px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 7px;
}
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  line-height: 1.8;
  color: #d9d5cd;
  margin: 7px 0 22px;
}
.consent input {
  appearance: none;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 1px solid #ded9ca;
  border-radius: 50%;
  margin: 2px 0;
  background: transparent;
}
.consent input:checked {
  background: var(--gold);
  box-shadow: inset 0 0 0 4px #292827;
}
.primary,
.secondary {
  width: 100%;
  min-height: 51px;
  border-radius: 28px;
  padding: 12px 18px;
  font-weight: 600;
  transition:
    filter 0.15s,
    transform 0.15s;
}
.primary {
  border: 1px solid #f1d9a3;
  color: #251d0d;
  background: linear-gradient(
    120deg,
    #f1d49a 0%,
    #c9a363 42%,
    #dfbd7b 76%,
    #f5dfa9 100%
  );
  box-shadow:
    inset 0 2px 2px #fff9,
    inset 0 -2px 3px #6c4a3444,
    0 3px 16px #a1793333;
}
.primary:hover {
  filter: brightness(1.07);
}
.primary:active,
.secondary:active {
  transform: translateY(1px);
}
.secondary {
  border: 1px solid #bda77c99;
  background: #ffffff07;
  color: var(--gold);
}
.footnote {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin: 15px 0 0;
}
.message {
  color: #ffd0bd;
  background: #a4402425;
  border: 1px solid #ce856957;
  border-radius: 10px;
  padding: 12px;
  margin: 12px 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.progress {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gold);
  margin: 16px 0;
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #d7bc7e50;
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
footer {
  text-align: center;
  color: #928c80;
  font-size: 11px;
  letter-spacing: 0.07em;
  padding: 26px 0 4px;
}
.success-hero {
  text-align: center;
  padding: 50px 0 30px;
}
.success-icon {
  display: grid;
  place-items: center;
  width: 75px;
  height: 75px;
  border: 1px solid #ddc69b88;
  border-radius: 50%;
  margin: 0 auto 26px;
  background: radial-gradient(circle at 20% 10%, #c0a06644, #252322 65%);
  box-shadow: inset 0 1px 5px #ffe8b866;
  font-size: 42px;
  color: var(--gold);
}
.receipt {
  padding: 28px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
}
.section-title span {
  font-size: 11px;
  color: var(--gold);
}
.receipt h2 {
  font-size: 30px;
  margin: 20px 0;
  overflow-wrap: anywhere;
}
dl {
  margin: 0;
}
dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 16px 0;
  font-size: 14px;
}
dt {
  color: var(--muted);
  flex-shrink: 0;
}
dd {
  margin: 0;
  text-align: right;
}
#again {
  margin-top: 20px;
}
dialog {
  background: #242424;
  color: var(--text);
  border: 1px solid #a68f66;
  border-radius: 24px;
  padding: 24px;
  max-width: 420px;
  width: calc(100% - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
}
dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(6px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.icon-button {
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 28px;
  min-width: 44px;
  min-height: 44px;
}
.crop-stage {
  margin: 16px auto;
  background: #161616;
  max-width: 280px;
}
.crop-stage canvas {
  display: block;
  width: 100%;
  touch-action: none;
  aspect-ratio: 33/48;
}
.crop-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}
.crop-controls label {
  font-size: 13px;
  white-space: nowrap;
}
.crop-controls input {
  width: 100%;
  min-width: 40px;
  accent-color: var(--gold);
}
.crop-controls button {
  width: auto;
  min-width: 100px;
  min-height: 42px;
  font-size: 12px;
  padding: 8px;
}
.nudge {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 12px;
}
.nudge button {
  min-width: 44px;
  min-height: 40px;
  border: 1px solid #ffffff33;
  background: #ffffff08;
  color: var(--gold);
  border-radius: 8px;
}
.admin-shell {
  max-width: 1280px;
  margin: auto;
  padding: 32px;
}
.admin-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 30px;
}
.admin-top h1 {
  font-size: 28px;
}
.admin-top .secondary {
  width: auto;
}
.admin-login {
  max-width: 440px;
  margin: 10vh auto;
}
.admin-login input {
  margin: 18px 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.stat {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #202124;
}
.stat strong {
  display: block;
  font-size: 32px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-size: 13px;
  color: var(--muted);
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}
.filters input {
  flex: 2;
  min-width: 170px;
}
.filters select {
  flex: 1;
  min-width: 125px;
}
.filters button {
  width: auto;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 13px;
}
th,
td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--muted);
  font-weight: 500;
  background: #212121;
}
td button {
  background: transparent;
  color: var(--gold);
  border: 1px solid #a98f6244;
  border-radius: 7px;
  padding: 7px 10px;
  min-height: 36px;
  margin: 2px;
}
td small {
  display: block;
  color: var(--muted);
  max-width: 230px;
  white-space: normal;
}
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 5px;
  background: #dfbe8119;
  color: var(--gold);
}
.badge.fail {
  color: #ffa8a0;
  background: #a6323220;
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
}
.pager button {
  width: auto;
  min-height: 40px;
}
.admin-note {
  font-size: 13px;
  color: var(--muted);
}
.audit-list {
  font-size: 13px;
  padding: 0;
  list-style: none;
}
.audit-list li {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.audit-list small {
  display: block;
  color: var(--muted);
}
.privacy {
  max-width: 700px;
  margin: 40px auto;
  padding: 24px;
}
.privacy h2 {
  font-size: 20px;
  margin-top: 28px;
}
.privacy p {
  margin: 12px 0;
  color: #d1cbc1;
}
.privacy h1 {
  font-size: 28px;
}
@media (min-width: 700px) {
  .phone-shell {
    margin: 24px auto;
    border: 1px solid #b8a07244;
    border-radius: 32px;
    min-height: calc(100svh - 48px);
  }
  body:has(.phone-shell) {
    background: radial-gradient(ellipse at 50% 40%, #2c2923, #0c0d0f 65%);
  }
}
@media (max-width: 390px) {
  .phone-shell {
    padding: 25px 15px;
  }
  .glass {
    padding: 22px 17px;
  }
  .hero {
    padding-top: 30px;
  }
  .brand {
    transform: scale(0.9);
    transform-origin: left center;
    margin-right: -22px;
  }
  h1 {
    font-size: 34px;
  }
}
@media (max-width: 700px) {
  .admin-shell {
    padding: 20px 14px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-top {
    align-items: flex-start;
  }
  .admin-top h1 {
    font-size: 23px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
@supports not (backdrop-filter: blur(10px)) {
  .glass {
    background: #2c2b28;
  }
}

/* Black-gold refraction follows the approved mockup; layers scale with the viewport. */
.phone-shell:before {
  width: 470px;
  height: 350px;
  top: -195px;
  right: -350px;
  transform: rotate(24deg);
  border: 2px solid #b99558;
  background:
    radial-gradient(
      ellipse at 24% 92%,
      #fff0bbbd 0,
      #c7a26a50 4%,
      transparent 11%
    ),
    radial-gradient(ellipse at 65% 25%, #dfc59460, transparent 46%),
    linear-gradient(
      140deg,
      #161719 14%,
      #4d4537 43%,
      #141516 63%,
      #9b7c48 91%,
      #ffe4a5
    );
  box-shadow:
    inset 0 -2px 3px #fff1be,
    inset 0 -8px 9px #0b0b0d,
    0 3px 0 #090a0c,
    0 5px 2px #d3aa67,
    0 14px 0 #171716,
    0 16px 2px #776140,
    0 27px 20px #0009;
}
.phone-shell:after {
  background: linear-gradient(
    90deg,
    transparent 25%,
    #0009 34%,
    #e5bd6b1a 35%,
    transparent 39%,
    transparent 61%,
    #edc58220 65%,
    #0008 69%,
    transparent 76%
  );
}
.glass {
  border-color: #d9bc8299;
  background:
    radial-gradient(ellipse at 1% 0%, #f3d59336, transparent 26%),
    radial-gradient(ellipse at 100% 100%, #ebc7842b, transparent 27%),
    linear-gradient(140deg, #4b4840b3, #232426e8 54%, #36322bc9);
  box-shadow:
    inset 0 1px 2px #ffe9b8c9,
    inset 1px 0 3px #edce9433,
    0 16px 45px #0005;
}
.primary {
  background:
    radial-gradient(ellipse at 12% 0%, #fff0bf, transparent 42%),
    radial-gradient(ellipse at 95% 100%, #fff0b8, transparent 31%),
    linear-gradient(120deg, #d3a45e, #e4c185 38%, #b68b4c 75%, #e8c685);
  box-shadow:
    inset 0 1px 2px #fff9d5,
    inset 0 -2px 2px #6e4a2a80,
    0 0 0 2px #9c77394d,
    0 2px 13px #d3a04b33;
}
.success-icon {
  background:
    radial-gradient(ellipse at 15% 6%, #ffe4a7a8, transparent 40%),
    radial-gradient(ellipse at 94% 90%, #c4a06b9c, transparent 35%), #242321;
  box-shadow:
    inset 0 1px 4px #ffe8b8b3,
    0 2px 3px #0008;
}
.stats {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 700px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Privacy stays in the registration flow, using the same black-gold glass. */
.privacy-dialog {
  max-width: 480px;
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  padding: 24px;
}
.privacy-dialog[open] {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.privacy-dialog .dialog-head,
.privacy-dialog > .primary {
  flex-shrink: 0;
}
.privacy-dialog .dialog-head {
  gap: 12px;
}
.privacy-dialog h2 {
  font-size: 24px;
}
.privacy-content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
  scrollbar-color: #b59b69 #242424;
}
.privacy-content h2 {
  font-size: 16px;
  color: var(--gold);
  margin: 22px 0 8px;
}
.privacy-content p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.85;
  color: #ded8ce;
}
.privacy-content .hint {
  font-size: 12px;
  color: var(--muted);
}
body:has(#privacy-dialog[open]) {
  overflow: hidden;
}
@media (max-width: 390px) {
  .privacy-dialog {
    padding: 20px 18px;
    gap: 14px;
  }
}
.captcha-dialog {
  width: min(380px, calc(100vw - 32px));
  padding: 24px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
.captcha-dialog .dialog-head {
  gap: 12px;
}
.captcha-dialog h2 {
  font-size: 24px;
}
#captcha-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #161616;
  margin: 18px 0;
}
#captcha-slider {
  width: 100%;
  min-height: 44px;
  accent-color: #d9bd80;
  cursor: grab;
  touch-action: pan-y;
}
#captcha-message {
  min-height: 2.8em;
  font-size: 14px;
  color: var(--gold);
}
.captcha-dialog label {
  font-size: 14px;
}
body:has(#captcha-dialog[open]) {
  overflow: hidden;
}
.submitting-dialog {
  width: min(360px, calc(100vw - 40px));
  padding: 36px 28px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 15% 0%, #f9dfa742, transparent 65%),
    linear-gradient(135deg, #3b352be8, #171613ed 60%, #79633e75);
  border: 1px solid #ead39b96;
  box-shadow:
    inset 0 1px 2px #fff0cda6,
    inset 0 -1px 18px #caa96520,
    0 22px 80px #0009;
  backdrop-filter: blur(24px) saturate(140%);
}
.submitting-dialog h2 {
  margin: 14px 0;
  color: #f7e6bd;
  font-size: 28px;
}
.submitting-dialog p {
  line-height: 1.8;
  font-size: 14px;
}
.gold-loader {
  width: 56px;
  height: 56px;
  margin: 0 auto 26px;
  border: 3px solid #c4a46235;
  border-top-color: #ffe4a9;
  border-right-color: #cba966;
  border-radius: 50%;
  box-shadow: 0 0 26px #d5af5a25;
  animation: gold-spin 1.1s linear infinite;
}
@keyframes gold-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .gold-loader {
    animation: none;
  }
}
body:has(#submitting-dialog[open]) {
  overflow: hidden;
}
.registration-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  margin-bottom: 24px;
}
.registration-control h2 {
  font-size: 20px;
  margin: 0 0 8px;
}
.registration-control p {
  margin: 0;
  color: var(--muted);
}
.registration-control button {
  width: auto;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .registration-control {
    flex-direction: column;
    align-items: stretch;
  }
}
