:root {
  --background: #fafaff;
  --surface: #ffffff;
  --surface-soft: #f7f8ff;
  --foreground: #1a1a2e;
  --muted: #5f6380;
  --border: #e6e6f2;
  --accent: #6b6bff;
  --accent-secondary: #4fa3ff;
  --accent-soft: #eef0ff;
  --ring: #cfd2ff;
  --shadow-soft: 0 10px 32px rgba(28, 35, 95, 0.06);
  --shadow-card: 0 6px 18px rgba(26, 31, 74, 0.05);
  --status-success-bg: #f6fffa;
  --status-success-fg: #2f8d5f;
  --status-success-border: #6fc191;
  --status-error-bg: #fff8fa;
  --status-error-border: #d86d7f;
  --radius-shell: 2rem;
  --radius-panel: 1.25rem;
  --radius-control: 1rem;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: Inter, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--foreground);
  display: flex;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(79, 163, 255, 0.1), transparent 36%),
    radial-gradient(circle at bottom left, rgba(107, 107, 255, 0.08), transparent 28%),
    var(--background);
}

button,
input {
  font: inherit;
}

.embed-shell {
  min-height: 100vh;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
  margin-inline: auto;
}

.module-shell {
  width: min(100%, 458px);
  max-width: 458px;
  border: 1px solid var(--border);
  border-radius: var(--radius-shell);
  background:
    radial-gradient(circle at 84% 10%, rgba(79, 163, 255, 0.2), transparent 32%),
    radial-gradient(circle at 18% 0%, rgba(107, 107, 255, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.985) 0%, rgba(247, 248, 255, 0.965) 100%);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  position: relative;
  overflow: visible;
  margin-inline: auto;
  isolation: isolate;
}

.module-shell::before {
  content: "";
  position: absolute;
  top: -22px;
  right: 24px;
  width: 200px;
  height: 128px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(79, 163, 255, 0.22), rgba(79, 163, 255, 0.08) 42%, transparent 74%);
  filter: blur(14px);
  opacity: 0.9;
  animation: presaleAmbientDrift 10s ease-in-out infinite alternate;
  z-index: 0;
}

.module-shell::after {
  content: "";
  position: absolute;
  top: -28px;
  left: 30px;
  width: 156px;
  height: 108px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(107, 107, 255, 0.16), rgba(107, 107, 255, 0.05) 48%, transparent 78%);
  filter: blur(18px);
  opacity: 0.85;
  animation: presaleAmbientDriftSecondary 12s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

.stack {
  position: relative;
  display: grid;
  gap: 16px;
  z-index: 1;
}

@keyframes presaleAmbientDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.72;
  }

  100% {
    transform: translate3d(10px, 8px, 0) scale(1.08);
    opacity: 0.95;
  }
}

@keyframes presaleAmbientDriftSecondary {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.56;
  }

  100% {
    transform: translate3d(-8px, 6px, 0) scale(1.06);
    opacity: 0.82;
  }
}

@keyframes presaleGoldAura {
  0% {
    transform: scale(0.94);
    opacity: 0.58;
  }

  100% {
    transform: scale(1.08);
    opacity: 0.9;
  }
}

@keyframes presalePhraseRotate {
  0% {
    opacity: 0;
    transform: translateY(-8px);
    filter: blur(4px);
  }

  3.45%,
  16.8% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }

  20%,
  100% {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .module-shell::before,
  .module-shell::after {
    animation: none;
  }

  .presale-title-aura::before,
  .presale-value-strip__phrase,
  .confirm-purchase-button::before,
  .confirm-purchase-button::after,
  .confirm-purchase-button,
  .amount-input-autofill {
    animation: none;
  }

  .presale-value-strip__phrase {
    opacity: 0;
    transform: none;
    filter: none;
  }

  .presale-value-strip__phrase:first-child {
    opacity: 1;
  }
}

.heading {
  display: grid;
  gap: 6px;
}

.heading-presale {
  justify-items: center;
  text-align: center;
}

.heading h1,
.status-title {
  margin: 0;
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", sans-serif;
  font-size: 1.55rem;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.presale-title-aura {
  position: relative;
  display: inline-block;
  isolation: isolate;
}

.presale-title-aura::before {
  content: "";
  position: absolute;
  inset: -16px -28px;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(246, 205, 104, 0.34), rgba(246, 205, 104, 0.12) 44%, transparent 72%);
  filter: blur(14px);
  opacity: 0.78;
  animation: presaleGoldAura 5.8s ease-in-out infinite alternate;
  z-index: -1;
}

.heading p,
.status-copy,
.helper-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.status-countdown {
  color: var(--accent);
  font-family: "Plus Jakarta Sans", Inter, "Segoe UI", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.status-timer-shell {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding-top: 6px;
}

.status-divider {
  width: 100%;
  height: 1px;
  background: rgba(230, 230, 242, 0.85);
}

.meter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--muted);
}

.presale-value-strip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: min(100%, 25rem);
  gap: 0.7rem;
  border: 1px solid rgba(230, 230, 242, 0.72);
  border-radius: 1.05rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(247, 248, 255, 0.46)),
    rgba(255, 255, 255, 0.42);
  box-shadow:
    0 12px 28px rgba(26, 31, 74, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  padding: 0.48rem 0.58rem 0.48rem 0.72rem;
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.presale-value-strip::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, rgba(107, 107, 255, 0), rgba(107, 107, 255, 0.32), rgba(79, 163, 255, 0.2), rgba(107, 107, 255, 0));
  opacity: 0.72;
}

.presale-value-strip__dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow:
    0 0 0 4px rgba(107, 107, 255, 0.08),
    0 0 16px rgba(107, 107, 255, 0.2);
  flex: 0 0 auto;
}

.presale-value-strip__label {
  color: rgba(95, 99, 128, 0.9);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.11em;
  line-height: 1;
}

.presale-value-strip__slot {
  position: relative;
  width: clamp(12.5rem, 44vw, 15.8rem);
  min-height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(207, 210, 255, 0.58);
  border-radius: 0.82rem;
  background:
    linear-gradient(180deg, rgba(238, 240, 255, 0.82), rgba(255, 255, 255, 0.62)),
    rgba(238, 240, 255, 0.42);
  box-shadow:
    0 7px 18px rgba(26, 31, 74, 0.035),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color: #22233c;
  font-size: 0.88rem;
  font-weight: 540;
  line-height: 1.35;
  text-align: center;
}

.presale-value-strip__phrase {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.8rem;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-8px);
  filter: blur(4px);
  animation: presalePhraseRotate cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

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

.form-grid {
  display: grid;
  gap: 12px;
}

.connected-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

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

.field-with-bubble {
  position: relative;
  overflow: visible;
  z-index: 2;
}

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

.field input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-card);
  padding: 0 14px;
  color: var(--foreground);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.field input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(207, 210, 255, 0.55), var(--shadow-card);
}

.field input[aria-invalid="true"] {
  border-color: var(--status-error-border);
  background: var(--status-error-bg);
  box-shadow: 0 0 0 3px rgba(216, 109, 127, 0.12), var(--shadow-card);
}

.field input.amount-input-autofill {
  animation: amountAutofillLift 900ms cubic-bezier(0.16, 1, 0.3, 1), amountNumberSettle 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.field input.amount-input-flow-right {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(238, 240, 255, 0.96), rgba(255, 255, 255, 0.92)),
    rgba(255, 255, 255, 0.92);
  background-size: 220% 100%;
  animation: amountAutofillLift 900ms cubic-bezier(0.16, 1, 0.3, 1), amountNumberSettle 900ms cubic-bezier(0.16, 1, 0.3, 1), amountFlowRight 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.field input.amount-input-flow-left {
  background:
    linear-gradient(270deg, rgba(255, 255, 255, 0.92), rgba(238, 240, 255, 0.96), rgba(255, 255, 255, 0.92)),
    rgba(255, 255, 255, 0.92);
  background-size: 220% 100%;
  animation: amountAutofillLift 900ms cubic-bezier(0.16, 1, 0.3, 1), amountNumberSettle 900ms cubic-bezier(0.16, 1, 0.3, 1), amountFlowLeft 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.field-bubble {
  position: absolute;
  left: 0;
  z-index: 14;
  width: min(320px, calc(100vw - 48px));
  border: 1px solid rgba(216, 109, 127, 0.28);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(255, 248, 250, 0.98), rgba(255, 255, 255, 0.97));
  box-shadow: 0 14px 34px rgba(160, 67, 87, 0.12);
  padding: 10px 12px;
  color: #a04357;
  font-size: 0.84rem;
  line-height: 1.45;
  pointer-events: none;
}

.field-bubble-transient {
  animation: bubbleFadeLifecycle 3.6s ease forwards;
}

.field-bubble::before,
.field-bubble::after {
  content: "";
  position: absolute;
  left: 22px;
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
}

.field-bubble-above {
  bottom: calc(100% + 10px);
}

.field-bubble-below {
  top: calc(100% + 10px);
}

.field-bubble-above::before {
  bottom: -8px;
  border-right: 1px solid rgba(216, 109, 127, 0.28);
  border-bottom: 1px solid rgba(216, 109, 127, 0.28);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(255, 248, 250, 0.98));
}

.field-bubble-above::after {
  bottom: -7px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(255, 248, 250, 0.98));
}

.field-bubble-below::before {
  top: -8px;
  border-top: 1px solid rgba(216, 109, 127, 0.28);
  border-left: 1px solid rgba(216, 109, 127, 0.28);
  background: linear-gradient(135deg, rgba(255, 248, 250, 0.98), rgba(255, 255, 255, 0.97));
}

.field-bubble-below::after {
  top: -7px;
  background: linear-gradient(135deg, rgba(255, 248, 250, 0.98), rgba(255, 255, 255, 0.97));
}

@keyframes bubbleFadeLifecycle {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }

  10%,
  70% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@keyframes amountAutofillLift {
  0% {
    transform: translateY(0);
    box-shadow: var(--shadow-card);
  }

  42% {
    transform: translateY(-1px);
    box-shadow: 0 0 0 3px rgba(207, 210, 255, 0.34), var(--shadow-card);
  }

  100% {
    transform: translateY(0);
    box-shadow: var(--shadow-card);
  }
}

@keyframes amountNumberSettle {
  0% {
    color: var(--foreground);
    letter-spacing: 0;
    text-shadow: none;
  }

  28% {
    color: var(--accent);
    letter-spacing: 0.015em;
    text-shadow: 0 0 14px rgba(107, 107, 255, 0.2);
  }

  100% {
    color: var(--foreground);
    letter-spacing: 0;
    text-shadow: none;
  }
}

@keyframes amountFlowRight {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: 0 0;
  }
}

@keyframes amountFlowLeft {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 100% 0;
  }
}

@keyframes confirmButtonAura {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.36;
  }

  50% {
    transform: scale(1.08);
    opacity: 0.78;
  }
}

@keyframes confirmButtonWave {
  0% {
    transform: scale(0.98);
    opacity: 0.38;
  }

  55% {
    opacity: 0.16;
  }

  100% {
    transform: scale(1.22);
    opacity: 0;
  }
}

@keyframes confirmButtonShellPulse {
  0%,
  100% {
    border-color: rgba(207, 210, 255, 0.68);
    box-shadow:
      0 0 0 0 rgba(107, 107, 255, 0.18),
      0 12px 26px rgba(40, 49, 110, 0.1);
  }

  50% {
    border-color: rgba(147, 149, 255, 0.98);
    box-shadow:
      0 0 0 8px rgba(107, 107, 255, 0.16),
      0 18px 34px rgba(40, 49, 110, 0.16);
  }
}

.note {
  border: 1px solid rgba(230, 230, 242, 0.9);
  border-radius: var(--radius-panel);
  background: rgba(255, 255, 255, 0.72);
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.actions {
  display: grid;
  gap: 10px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.button {
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 200ms ease, opacity 200ms ease, border-color 200ms ease, background 200ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.85);
  color: var(--foreground);
  border-color: var(--border);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.confirm-purchase-button {
  position: relative;
  overflow: visible;
  isolation: isolate;
  border-color: rgba(207, 210, 255, 0.55);
  box-shadow:
    0 0 0 0 rgba(107, 107, 255, 0.2),
    0 12px 26px rgba(40, 49, 110, 0.08);
  animation: confirmButtonShellPulse 2.8s ease-in-out infinite;
}

.confirm-purchase-button::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(107, 107, 255, 0.38), rgba(79, 163, 255, 0.28), rgba(107, 107, 255, 0.38));
  filter: blur(15px);
  opacity: 0.58;
  animation: confirmButtonAura 2.8s ease-in-out infinite;
  z-index: -1;
}

.confirm-purchase-button::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid rgba(147, 149, 255, 0.42);
  border-radius: inherit;
  opacity: 0;
  animation: confirmButtonWave 2.35s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  z-index: -1;
}

.trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.trust img {
  width: 24px;
  height: 24px;
  display: block;
}

.trust span {
  font-size: 0.8rem;
  color: var(--muted);
}

.feedback {
  border-radius: var(--radius-panel);
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.feedback-error {
  background: var(--status-error-bg);
  border: 1px solid var(--status-error-border);
  color: #a04357;
}

.feedback-success {
  background: var(--status-success-bg);
  border: 1px solid var(--status-success-border);
  color: var(--status-success-fg);
}

.status-shell {
  display: grid;
  gap: 16px;
}

.status-meta {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.status-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}

.status-row dt {
  color: var(--muted);
}

.status-row dd {
  margin: 0;
  max-width: 62%;
  text-align: right;
  word-break: break-word;
}

.status-actions {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.status-waiting-button {
  width: min(100%, 320px);
}

.status-waiting-button-primary {
  min-height: 50px;
}

.status-waiting-button-secondary {
  width: min(100%, 260px);
  min-height: 44px;
}

.subtle-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.status-link-stack {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.status-link-note {
  max-width: 320px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.status-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 320px);
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(107, 107, 255, 0.42);
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(40, 49, 110, 0.05);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.status-button:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 163, 255, 0.55);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(238, 240, 255, 0.72));
  color: var(--accent-secondary);
  box-shadow: 0 12px 24px rgba(40, 49, 110, 0.08);
}

.status-button-secondary {
  width: min(100%, 284px);
  min-height: 40px;
  font-size: 0.9rem;
  font-weight: 500;
}

.status-button-primary {
  min-height: 50px;
  font-size: 0.98rem;
  font-weight: 600;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: min(calc(100vw - 32px), 360px);
  border: 1px solid rgba(107, 107, 255, 0.22);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 248, 255, 0.98));
  color: var(--foreground);
  box-shadow: 0 14px 34px rgba(28, 35, 95, 0.12);
  padding: 12px 14px;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.45;
  z-index: 40;
}

.loading {
  min-height: 270px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.18);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal {
  width: min(100%, 410px);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-soft);
  padding: 20px;
  display: grid;
  gap: 14px;
}

.modal h2 {
  margin: 0;
  font-size: 1.18rem;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  line-height: 1.15;
}

.modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 520px) {
  .embed-shell {
    min-height: 100dvh;
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 12px;
  }

  .module-shell {
    width: min(100%, 420px);
    padding: 20px 18px;
    border-radius: 1.6rem;
    margin-inline: auto;
  }

  .connected-inputs,
  .modal-actions {
    grid-template-columns: 1fr;
  }

  .presale-value-strip {
    width: min(100%, 22.5rem);
    flex-direction: column;
    gap: 0.38rem;
    padding: 0.64rem;
  }

  .presale-value-strip__dot {
    display: none;
  }

  .presale-value-strip__slot {
    width: 100%;
    min-height: 2.25rem;
    font-size: 0.9rem;
  }

  .field-bubble {
    width: calc(100vw - 56px);
    max-width: 100%;
  }

  .heading h1,
  .status-title {
    font-size: 1.42rem;
  }
}
