:root {
  --totem-ink: #14201a;
  --totem-forest: #213b2e;
  --totem-leaf: #2f6b4f;
  --totem-mint: #d8efe4;
  --totem-cream: #f3f6f2;
  --totem-screen: #f7faf7;
  --totem-metal: #2a322e;
  --totem-metal-hi: #3d4842;
  --totem-font-brand: "Sora", sans-serif;
  --totem-font-ui: "Figtree", sans-serif;
}

.totem-page {
  min-height: 100%;
  margin: 0;
  font-family: var(--totem-font-ui);
  color: var(--totem-ink);
  background: #1c2420;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 3rem;
  position: relative;
}

.totem-room {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(47, 107, 79, 0.28), transparent 55%),
    linear-gradient(180deg, #3a4540 0%, #2a332f 42%, #1a211e 72%, #121816 100%);
  pointer-events: none;
}

.totem-room::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 47px,
      rgba(255, 255, 255, 0.015) 47px,
      rgba(255, 255, 255, 0.015) 48px
    );
  opacity: 0.6;
}

.totem-room::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38%;
  background:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.35)),
    repeating-linear-gradient(
      90deg,
      #2e3833 0,
      #2e3833 12px,
      #26302b 12px,
      #26302b 24px
    );
  mask-image: linear-gradient(180deg, transparent, #000 30%);
}

.totem {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: totem-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes totem-rise {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.totem-shell {
  width: 100%;
  background:
    linear-gradient(145deg, var(--totem-metal-hi) 0%, var(--totem-metal) 40%, #1c221f 100%);
  border-radius: 28px;
  padding: 14px 14px 18px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 28px 50px rgba(0, 0, 0, 0.45),
    0 8px 16px rgba(0, 0, 0, 0.3);
}

.totem-camera {
  width: 10px;
  height: 10px;
  margin: 2px auto 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #4a5550, #0d100e 70%);
  box-shadow: 0 0 0 2px #1a201c;
}

.totem-screen {
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, var(--totem-mint), transparent 50%),
    linear-gradient(180deg, var(--totem-cream) 0%, var(--totem-screen) 100%);
  border-radius: 18px;
  padding: 1.75rem 1.35rem 1.5rem;
  min-height: min(72vh, 640px);
  display: flex;
  flex-direction: column;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.2) inset,
    0 0 40px rgba(33, 59, 46, 0.08) inset;
  animation: screen-on 0.55s ease 0.15s both;
}

@keyframes screen-on {
  from {
    opacity: 0.35;
    filter: brightness(0.85);
  }
  to {
    opacity: 1;
    filter: brightness(1);
  }
}

.totem-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.totem-brand-issuer {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--totem-leaf);
}

.totem-brand-name {
  margin: 0;
  font-family: var(--totem-font-brand);
  font-size: clamp(1.75rem, 6vw, 2.15rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--totem-forest);
}

.order-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-align: center;
  margin-bottom: 1.35rem;
  padding: 1rem 0.75rem;
  background: rgba(33, 59, 46, 0.06);
  border-radius: 14px;
  border: 1px solid rgba(33, 59, 46, 0.1);
  animation: order-in 0.5s ease 0.35s both;
}

@keyframes order-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.order-summary .order-number {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5a6b62;
  line-height: 1.2;
}

.order-summary .order-amount {
  font-family: var(--totem-font-brand);
  font-size: clamp(2.25rem, 8vw, 2.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--totem-forest);
  font-variant-numeric: tabular-nums;
}

.totem-prompt {
  margin: 0 0 1.35rem;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.45;
  color: #3d4a44;
}

.totem-prompt strong {
  color: var(--totem-leaf);
  font-weight: 700;
}

.totem-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.totem-field .form-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--totem-ink);
  margin-bottom: 0.4rem;
}

.totem-field .form-control {
  min-height: 3.4rem;
  border-radius: 12px;
  border-color: #c5d0c9;
  font-size: 1.15rem;
  background: #fff;
}

.totem-field .form-control:focus {
  border-color: var(--totem-leaf);
}

.btn-totem {
  margin-top: auto;
  min-height: 3.6rem;
  border: none;
  border-radius: 14px;
  font-family: var(--totem-font-ui);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(180deg, #3a7d5c 0%, var(--totem-forest) 100%);
  box-shadow: 0 4px 0 #162820;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn-totem:hover {
  color: #fff;
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #162820;
}

.btn-totem:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #162820;
}

.totem-alt {
  display: block;
  margin-top: 1.1rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: #6a7a72;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.totem-alt:hover {
  color: var(--totem-forest);
}

.totem-neck {
  width: 22%;
  height: 36px;
  background: linear-gradient(90deg, #1a201c, #2f3934 40%, #1a201c);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.totem-base {
  width: 58%;
  height: 18px;
  border-radius: 4px 4px 8px 8px;
  background: linear-gradient(180deg, #3a4540, #1e2622);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

@media (max-width: 520px) {
  .totem-page {
    padding: 0;
    background: var(--totem-screen);
    align-items: stretch;
  }

  .totem-room,
  .totem-camera,
  .totem-neck,
  .totem-base {
    display: none;
  }

  .totem {
    width: 100%;
    min-height: 100dvh;
    animation: none;
  }

  .totem-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    padding: 0;
    background: none;
    box-shadow: none;
  }

  .totem-screen {
    flex: 1;
    border-radius: 0;
    min-height: 100dvh;
    padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
    animation: screen-on 0.4s ease both;
  }
}
