:root {
  --bg: #050816;
  --bg-2: #0b1024;
  --card: rgba(15, 23, 42, 0.92);
  --card-strong: rgba(17, 24, 39, 0.98);
  --border: rgba(148, 163, 184, 0.22);
  --border-strong: rgba(56, 189, 248, 0.45);
  --text: #f8fafc;
  --muted: #aeb8c8;
  --muted-2: #7b879b;
  --accent: #38bdf8;
  --accent-2: #22c55e;
  --danger: #fb7185;
  --warning: #facc15;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --focus: 0 0 0 4px rgba(56, 189, 248, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.22), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.16), transparent 28rem),
    linear-gradient(145deg, var(--bg), var(--bg-2));
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
  display: grid;
  gap: 16px;
  align-content: start;
}

.hero-card,
.form-card,
.help-card {
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  padding: 22px;
  border-radius: var(--radius-xl);
}

.brand-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: -0.08em;
  color: #03111f;
  background: linear-gradient(135deg, var(--accent), #a7f3d0);
  box-shadow: 0 18px 46px rgba(56, 189, 248, 0.22);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-size: clamp(1.65rem, 7vw, 2.45rem);
  letter-spacing: -0.055em;
}

h2 {
  font-size: 1.05rem;
  letter-spacing: -0.025em;
}

.intro {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.98rem;
}

.token-panel {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(2, 132, 199, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.token-label {
  color: var(--muted);
  font-size: 0.84rem;
}

#tokenText {
  font-size: 1.28rem;
  letter-spacing: 0.12em;
  color: #e0f2fe;
}

.alert {
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  line-height: 1.4;
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.85);
}

.alert.success {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(22, 101, 52, 0.22);
}

.alert.error {
  border-color: rgba(251, 113, 133, 0.48);
  background: rgba(127, 29, 29, 0.25);
}

.alert.warning {
  border-color: rgba(250, 204, 21, 0.48);
  background: rgba(113, 63, 18, 0.25);
}

.form-card {
  padding: 14px;
  border-radius: var(--radius-xl);
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border-radius: 22px;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.mode-button {
  min-height: 48px;
  border: 0;
  border-radius: 17px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}

.mode-button:active {
  transform: scale(0.98);
}

.mode-button.active {
  color: #04111f;
  background: linear-gradient(135deg, var(--accent), #86efac);
}

form {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.form-panel {
  display: none;
  gap: 14px;
}

.form-panel.active {
  display: grid;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: #dbeafe;
  font-size: 0.9rem;
  font-weight: 800;
}

.field em {
  color: var(--muted-2);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  background: rgba(2, 6, 23, 0.72);
  outline: none;
  padding: 14px 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

input::placeholder,
textarea::placeholder {
  color: rgba(148, 163, 184, 0.68);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--border-strong);
  box-shadow: var(--focus);
  background: rgba(2, 6, 23, 0.9);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.submit-button {
  min-height: 56px;
  border: 0;
  border-radius: 19px;
  color: #03111f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 950;
  letter-spacing: -0.025em;
  box-shadow: 0 18px 52px rgba(34, 197, 94, 0.18);
  transition: transform 140ms ease, opacity 140ms ease, filter 140ms ease;
}

.submit-button:active {
  transform: translateY(1px) scale(0.99);
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  filter: grayscale(0.35);
}

.help-card {
  padding: 18px;
  border-radius: var(--radius-xl);
}

.help-card ol {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.small-note {
  margin: 12px 0 0;
  color: var(--muted-2);
  font-size: 0.88rem;
}

@media (min-width: 560px) {
  .app-shell {
    padding-top: 38px;
  }

  .hero-card,
  .form-card,
  .help-card {
    padding: 26px;
  }
}
