:root {
  color-scheme: light;
  --tron-red: #dc062b;
  --tron-red-dark: #a80020;
  --tron-red-soft: #fff0f3;
  --ink: #242729;
  --muted: #70757b;
  --line: #e7e8ea;
  --surface: #ffffff;
  --page: #f5f6f8;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--page);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--page); }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell { width: min(100%, 560px); min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: var(--page); overflow: hidden; }
.topbar {
  height: 78px; padding: calc(12px + env(safe-area-inset-top)) 20px 12px;
  display: flex; align-items: center; gap: 11px; background: rgba(255,255,255,.94);
  border-bottom: 1px solid rgba(36,39,41,.07); position: relative; z-index: 5;
}
.brand-mark { width: 42px; height: 42px; position: relative; display: grid; place-items: center; background: var(--tron-red); border-radius: 13px 13px 13px 4px; box-shadow: 0 8px 20px rgba(220,6,43,.26); }
.brand-mark::before, .brand-mark::after, .brand-mark span { content: ""; position: absolute; border: 2px solid white; transform: rotate(30deg) skew(-9deg); }
.brand-mark::before { width: 21px; height: 16px; border-bottom: 0; }
.brand-mark::after { width: 11px; height: 21px; border-left: 0; left: 18px; top: 10px; }
.brand-mark span { width: 15px; height: 12px; border-top: 0; right: 10px; bottom: 9px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy strong { font-size: 15px; letter-spacing: .08em; }
.brand-copy span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.network-pill { margin-left: auto; padding: 7px 10px; border: 1px solid #e6e7e9; border-radius: 999px; color: #5e6267; background: #fafafa; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.network-pill i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #21b26b; box-shadow: 0 0 0 3px rgba(33,178,107,.12); }

main { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.view { display: none; }
.view.is-active { display: block; animation: rise .4s cubic-bezier(.22,.8,.36,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.hero { position: relative; overflow: hidden; padding: 36px 22px 32px; color: white; background: linear-gradient(135deg, #7c0018 0%, var(--tron-red) 60%, #f42145 100%); }
.hero::before { content: ""; position: absolute; width: 180px; height: 180px; right: -75px; top: -95px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero::after { content: ""; position: absolute; width: 90px; height: 90px; right: 54px; bottom: -57px; border: 1px solid rgba(255,255,255,.18); transform: rotate(45deg); }
.hero .eyebrow { position: relative; z-index: 1; font-size: 10px; font-weight: 800; letter-spacing: .18em; opacity: .72; }
.hero h1 { position: relative; z-index: 1; margin: 10px 0 8px; font-size: 31px; letter-spacing: -.03em; }
.hero p { position: relative; z-index: 1; margin: 0; font-size: 14px; opacity: .82; }
.hero-orbit { position: absolute; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.orbit-one { width: 250px; height: 70px; right: -80px; top: 34px; transform: rotate(-22deg); }
.orbit-two { width: 160px; height: 38px; right: -24px; top: 49px; transform: rotate(27deg); }

form { padding: 22px 18px 10px; }
.form-section { padding: 18px; border-radius: 20px; background: var(--surface); box-shadow: 0 8px 25px rgba(35,39,43,.055); border: 1px solid rgba(36,39,41,.055); }
.field-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.field-heading > div { display: flex; align-items: center; gap: 9px; }
.field-heading strong { font-size: 15px; }
.field-heading small { color: #93979c; font-size: 11px; }
.field-index { width: 25px; height: 25px; display: grid; place-items: center; color: white; background: var(--tron-red); border-radius: 8px 8px 8px 3px; font-size: 12px; font-weight: 800; }
.field-index.secondary { background: var(--ink); }
.input-wrap { display: flex; align-items: center; min-height: 54px; padding: 0 10px 0 14px; background: #fafafa; border: 1.5px solid #e3e4e6; border-radius: 15px; transition: border-color .2s, box-shadow .2s, background .2s; }
.input-wrap:focus-within { border-color: var(--tron-red); background: white; box-shadow: 0 0 0 4px rgba(220,6,43,.08); }
.input-wrap.has-error { border-color: var(--tron-red); background: #fff8f9; }
.input-wrap svg { width: 20px; height: 20px; flex: 0 0 auto; fill: var(--tron-red); }
.secondary-input svg { fill: var(--ink); }
.input-wrap input { min-width: 0; flex: 1; height: 52px; padding: 0 10px; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 13px; }
.input-wrap input::placeholder { color: #b2b4b8; }
.clear-button { width: 28px; height: 28px; display: none; align-items: center; justify-content: center; padding: 0; color: #92969a; background: #eceef0; border: 0; border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; }
.input-wrap.has-value .clear-button { display: flex; }
.field-error { min-height: 0; margin: 7px 3px -3px; color: var(--tron-red); font-size: 11px; }
.field-error:not(:empty) { min-height: 16px; }

.flow-line { height: 30px; margin-left: 31px; display: flex; align-items: center; gap: 8px; color: #b1b4b8; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.flow-line::before { content: ""; width: 1px; height: 100%; background: linear-gradient(var(--tron-red), #cfd1d4); }

.benefit-row { margin: 16px 0 15px; padding: 17px; display: grid; grid-template-columns: 1fr 1px 1fr; gap: 14px; border-radius: 18px; color: white; background: var(--ink); box-shadow: 0 10px 24px rgba(36,39,41,.14); }
.benefit-row div { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.benefit-row strong { font-size: 20px; letter-spacing: -.02em; }
.benefit-row span { color: #b9bdc0; font-size: 10px; }
.benefit-row i { width: 1px; background: rgba(255,255,255,.14); }

.primary-button { width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 10px; color: white; background: linear-gradient(110deg, var(--tron-red-dark), var(--tron-red)); border: 0; border-radius: 17px; box-shadow: 0 13px 28px rgba(220,6,43,.27); font-size: 16px; font-weight: 800; cursor: pointer; transition: transform .15s, filter .15s; }
.primary-button:active { transform: scale(.985); filter: brightness(.96); }
.primary-button svg { width: 20px; fill: currentColor; }
.primary-label { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.primary-label strong { font-size: 16px; }
.primary-label small { font-size: 9px; font-weight: 600; opacity: .72; }
.security-note { margin: 14px 0 0; text-align: center; color: #8b8f93; font-size: 10px; }
.security-note span { color: #21a665; font-weight: 900; }

.success-view { padding: 28px 18px 12px; }
.success-hero { text-align: center; }
.success-ring { width: 80px; height: 80px; margin: 3px auto 13px; display: grid; place-items: center; color: white; border-radius: 50%; background: var(--tron-red); box-shadow: 0 0 0 9px #ffe8ed, 0 14px 30px rgba(220,6,43,.28); animation: pop .5s cubic-bezier(.2,1.7,.4,1) both; }
.success-ring svg { width: 42px; fill: currentColor; }
@keyframes pop { from { transform: scale(.55); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.demo-pill { display: inline-block; margin-top: 9px; padding: 6px 9px; color: #787c80; background: #ebecee; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.success-hero h1 { margin: 11px 0 5px; font-size: 28px; }
.success-hero p { margin: 0; color: var(--muted); font-size: 13px; }

.countdown-card { margin-top: 22px; padding: 20px; text-align: center; color: white; background: linear-gradient(135deg, #242729, #3d4144); border-radius: 20px; box-shadow: 0 12px 30px rgba(36,39,41,.17); }
.countdown-card > span { color: #c4c7ca; font-size: 11px; }
.countdown-card > strong { display: block; margin: 4px 0 10px; font-variant-numeric: tabular-nums; font-size: 43px; letter-spacing: .05em; }
.progress-track { height: 5px; overflow: hidden; background: rgba(255,255,255,.12); border-radius: 99px; }
.progress-track i { display: block; width: 100%; height: 100%; background: var(--tron-red); border-radius: inherit; transition: width 1s linear; }
.countdown-card small { display: block; margin-top: 10px; color: #aeb1b4; font-size: 10px; }

.result-card { margin-top: 16px; padding: 19px; background: white; border: 1px solid rgba(36,39,41,.06); border-radius: 20px; box-shadow: 0 8px 25px rgba(35,39,43,.055); }
.result-card h2 { margin: 0 0 8px; font-size: 15px; }
.result-row { min-width: 0; padding: 13px 0; display: grid; grid-template-columns: 118px minmax(0,1fr); align-items: center; gap: 8px; border-bottom: 1px solid #eff0f1; }
.result-row:last-child { border-bottom: 0; }
.result-row span { color: #7c8084; font-size: 10px; }
.result-row strong { min-width: 0; overflow: hidden; text-align: right; font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.result-row.address-row { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.result-row.address-row strong { width: 100%; overflow: visible; color: #34373a; text-align: left; font-size: 11px; line-height: 1.55; text-overflow: clip; white-space: normal; word-break: break-all; }
.result-row .dot { width: 7px; height: 7px; display: inline-block; margin-right: 6px; border-radius: 2px; }
.dot.red { background: var(--tron-red); }
.dot.dark { background: var(--ink); }
.dot.grey { background: #a0a1a2; }
.result-row.energy-result strong { color: var(--tron-red); font-family: inherit; font-size: 14px; }

.success-notice { margin-top: 14px; padding: 14px; display: flex; gap: 10px; color: #6d7175; background: #fff6e6; border: 1px solid #ffe0a2; border-radius: 15px; }
.success-notice svg { width: 20px; height: 20px; flex: 0 0 auto; fill: #e19200; }
.success-notice p { margin: 0; font-size: 10px; line-height: 1.6; }
.success-notice strong { color: #7f5300; }
.outline-button { width: 100%; min-height: 52px; margin-top: 15px; color: var(--tron-red); background: white; border: 1.5px solid rgba(220,6,43,.28); border-radius: 15px; font-size: 14px; font-weight: 750; cursor: pointer; }

@media (min-width: 561px) {
  body { padding: 28px 0; }
  .app-shell { min-height: auto; border-radius: 28px; box-shadow: 0 24px 70px rgba(36,39,41,.14); }
  .topbar { padding-top: 12px; }
}

@media (max-width: 380px) {
  .topbar { padding-left: 15px; padding-right: 15px; }
  .hero { padding-left: 18px; }
  form, .success-view { padding-left: 13px; padding-right: 13px; }
  .field-heading small { display: none; }
}

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