/* Fundo animado */
.aurora {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 85% -10%, #123073 0%, transparent 60%),
    radial-gradient(900px 600px at -10% 110%, #0d2560 0%, transparent 60%),
    var(--bg);
}

.aurora::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(150, 185, 255, 0.13) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 10%, transparent 72%);
}

.aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  animation: float 16s ease-in-out infinite alternate;
}

.aurora span:nth-child(1) {
  width: 420px;
  height: 420px;
  top: -130px;
  right: -60px;
  background: rgba(200, 245, 66, 0.13);
}

.aurora span:nth-child(2) {
  width: 520px;
  height: 520px;
  bottom: -220px;
  left: -140px;
  background: rgba(58, 118, 255, 0.24);
  animation-delay: -6s;
}

.aurora span:nth-child(3) {
  width: 300px;
  height: 300px;
  top: 40%;
  left: 55%;
  background: rgba(58, 118, 255, 0.12);
  animation-delay: -11s;
}

@keyframes float {
  to {
    transform: translate3d(-50px, 40px, 0) scale(1.12);
  }
}

#app {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Topo */
.topbar {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 18px 20px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--lime);
  color: var(--on-lime);
  animation: mark-in 0.6s var(--spring) both;
}

.brand strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand span {
  color: var(--ink-3);
  font-size: 13px;
}

.brand > div {
  min-width: 0;
}

.who {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(12, 29, 74, 0.7);
  font-size: 13px;
  font-weight: 700;
  max-width: 190px;
}

.who span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.who button {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-3);
  transition: background 0.16s, color 0.16s;
}

.who button:hover {
  background: var(--card-3);
  color: var(--ink);
}

@keyframes mark-in {
  from {
    transform: scale(0.5) rotate(-14deg);
    opacity: 0;
  }
}

/* Etapas */
.steps {
  width: min(100%, 560px);
  margin: 14px auto 0;
  padding: 0 20px;
  display: flex;
  align-items: center;
  list-style: none;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-3);
}

.steps li:last-child {
  flex: none;
}

.steps .dot {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  font-size: 12px;
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.4s var(--spring);
}

.steps .bar {
  flex: 1;
  height: 2px;
  margin: 0 8px;
  border-radius: 2px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}

.steps .bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}

.steps li.done .bar::after {
  transform: scaleX(1);
}

.steps li.done .dot {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
}

.steps li.current {
  color: var(--ink);
}

.steps li.current .dot {
  border-color: var(--lime);
  color: var(--lime);
  transform: scale(1.1);
  box-shadow: 0 0 0 4px var(--lime-soft);
}

@media (max-width: 560px) {
  .steps .label {
    display: none;
  }
}

/* Palco com transição entre telas */
#stage {
  flex: 1;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 22px 20px 120px;
}

#stage.leave {
  animation: leave-left 0.17s ease-in both;
}

#stage.leave-back {
  animation: leave-right 0.17s ease-in both;
}

#stage.enter {
  animation: enter-right 0.36s var(--ease) both;
}

#stage.enter-back {
  animation: enter-left 0.36s var(--ease) both;
}

@keyframes leave-left {
  to {
    opacity: 0;
    transform: translateX(-26px);
  }
}

@keyframes leave-right {
  to {
    opacity: 0;
    transform: translateX(26px);
  }
}

@keyframes enter-right {
  from {
    opacity: 0;
    transform: translateX(34px);
  }
}

@keyframes enter-left {
  from {
    opacity: 0;
    transform: translateX(-34px);
  }
}

/* Painéis de formulário */
.panel {
  width: min(100%, 480px);
  margin: 14px auto 0;
  padding: 30px;
  border-radius: 24px;
  background: rgba(12, 29, 74, 0.78);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--lime);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.panel h1 {
  margin-top: 10px;
  font-size: clamp(26px, 6vw, 32px);
}

.panel h1 em {
  font-style: normal;
  color: var(--lime);
}

.panel .lead {
  margin-top: 8px;
  color: var(--ink-2);
}

.form-stack {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.fine-print {
  margin-top: 14px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
}

@media (max-width: 560px) {
  .panel {
    padding: 22px 18px;
    border-radius: 20px;
  }
}

/* Código de verificação */
.otp {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 22px;
}

.otp input {
  width: 100%;
  aspect-ratio: 5 / 6;
  min-width: 0;
  border-radius: 13px;
  border: 1.5px solid var(--line-strong);
  background: rgba(4, 12, 36, 0.6);
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(20px, 6vw, 26px);
  font-weight: 700;
  caret-color: var(--lime);
  transition: border-color 0.16s, box-shadow 0.2s, transform 0.25s var(--spring), background 0.2s;
}

.otp input:focus {
  outline: 0;
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(200, 245, 66, 0.18);
  transform: translateY(-2px);
}

.otp input.filled {
  border-color: var(--lime);
  background: var(--lime-soft);
}

.otp.error {
  animation: shake 0.38s;
}

.otp.error input {
  border-color: var(--danger);
}

.otp-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
}

.dev-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 13.5px;
  font-weight: 600;
}

.dev-note .icon {
  flex: none;
}

/* Catálogo */
.catalog-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.catalog-head h1 {
  font-size: clamp(24px, 5vw, 32px);
}

.catalog-head p {
  color: var(--ink-2);
  margin-top: 4px;
}

.search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 340px;
}

.search .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.search .input {
  padding-left: 42px;
  border-radius: 999px;
}

.filters {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding: 2px 0 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(12, 29, 74, 0.7);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 700;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.25s var(--spring);
}

.chip:hover {
  border-color: #3f66bd;
  color: var(--ink);
}

.chip:active {
  transform: scale(0.95);
}

.chip.active {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 16px;
  perspective: 1400px;
}

@media (max-width: 560px) {
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

/* Cartão de item: inclina e acompanha o ponteiro */
.item-card {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform 0.28s var(--ease), border-color 0.25s, box-shadow 0.3s;
  will-change: transform;
}

.item-wrap {
  display: flex;
  animation: rise 0.55s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 55ms);
  min-width: 0;
}

.item-wrap .item-card {
  width: 100%;
}

.item-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 22px 44px rgba(2, 8, 28, 0.55);
}

.item-card.in-cart {
  border-color: var(--lime);
}

.item-photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.item-photo .photo-frame {
  position: absolute;
  inset: 0;
}

.item-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(200, 245, 66, 0.22), transparent 70%);
  transition: opacity 0.3s;
  pointer-events: none;
}

.item-card:hover .item-photo::after {
  opacity: 1;
}

.item-card:hover .photo-frame.loaded img {
  transform: scale(1.09) translate(calc((50% - var(--mx)) * 0.05), calc((50% - var(--my)) * 0.05));
}

/* Em telas de toque não há ponteiro: a foto respira quando entra na tela. */
@media (hover: none) {
  .item-card.in-view .photo-frame.loaded img {
    animation: drift 8s ease-in-out infinite alternate;
  }
}

@keyframes drift {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.09) translateY(-2%);
  }
}

.item-photo .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(5, 14, 40, 0.8);
  backdrop-filter: blur(6px);
  z-index: 1;
}

.item-card.sold-out .photo-frame img {
  filter: grayscale(1) brightness(0.7);
}

.item-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
  padding: 14px;
}

.item-body h3 {
  font-size: 15.5px;
  line-height: 1.25;
}

.item-desc {
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-foot {
  margin-top: auto;
  padding-top: 10px;
}

.item-stock {
  display: block;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 8px;
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 42px;
  padding: 3px;
  border-radius: 12px;
  background: var(--lime);
  color: var(--on-lime);
  animation: pop 0.3s var(--spring);
}

.stepper button {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  transition: background 0.14s, transform 0.14s;
}

.stepper button:hover {
  background: rgba(7, 19, 48, 0.12);
}

.stepper button:active {
  transform: scale(0.88);
}

.stepper button[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.stepper input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.stepper.soft {
  background: var(--card-2);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  animation: none;
}

.stepper.soft button:hover {
  background: var(--card-3);
}

@keyframes pop {
  from {
    transform: scale(0.9);
  }
}

/* Barra do carrinho */
.cartbar {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: min(calc(100% - 32px), 560px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  border-radius: 18px;
  background: rgba(17, 40, 95, 0.92);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transform: translate(-50%, 160px);
  visibility: hidden;
  transition: transform 0.42s var(--spring), visibility 0.42s;
}

.cartbar.show {
  transform: translate(-50%, 0);
  visibility: visible;
}

.cart-icon {
  position: relative;
  flex: none;
  color: var(--lime);
}

.cart-icon.bump {
  animation: bump 0.4s var(--spring);
}

@keyframes bump {
  40% {
    transform: scale(1.32) rotate(-6deg);
  }
}

.cart-text {
  flex: 1;
  min-width: 0;
}

.cart-text strong {
  display: block;
  font-size: 14.5px;
}

.cart-text span {
  display: block;
  color: var(--ink-3);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fly-ghost {
  position: fixed;
  z-index: 40;
  object-fit: cover;
  pointer-events: none;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

/* Detalhe do item */
.detail-photo {
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
}

.detail-photo .photo-frame {
  height: 100%;
}

.detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.detail-text {
  margin-top: 10px;
  color: var(--ink-2);
  white-space: pre-line;
}

.spec-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin: 14px 0 0;
  font-size: 14px;
}

.spec-list dt {
  color: var(--ink-3);
}

.spec-list dd {
  margin: 0;
  font-weight: 600;
}

/* Revisão */
.review {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 860px) {
  .review {
    grid-template-columns: minmax(0, 1fr);
  }
}

.review h1 {
  font-size: clamp(24px, 5vw, 30px);
}

.review-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet {
  border-radius: 20px;
  background: rgba(12, 29, 74, 0.82);
  border: 1px solid var(--line);
  padding: 8px 16px;
}

.sheet.pad {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.sheet h2 {
  font-size: 16px;
}

.line {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 132px 36px;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  animation: rise 0.4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

.line:last-child {
  border-bottom: 0;
}

.line-photo {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
}

.line-photo .photo-frame {
  height: 100%;
}

.line h3 {
  font-size: 14.5px;
  line-height: 1.3;
}

.line .badge {
  margin-top: 4px;
}

.line-remove {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--ink-3);
  transition: background 0.16s, color 0.16s;
}

.line-remove:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.line.removing {
  animation: line-out 0.24s ease-in both;
}

@keyframes line-out {
  to {
    opacity: 0;
    transform: translateX(30px);
  }
}

@media (max-width: 560px) {
  .line {
    grid-template-columns: 56px minmax(0, 1fr) 36px;
    row-gap: 8px;
  }

  .line-photo {
    width: 56px;
    height: 56px;
  }

  .line .stepper {
    grid-column: 2 / 4;
    grid-row: 2;
  }

  .line-remove {
    grid-column: 3;
    grid-row: 1;
  }
}

.notice {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: #cfe3ff;
  font-size: 13.5px;
}

.notice .icon {
  flex: none;
  margin-top: 1px;
  color: var(--blue);
}

.totals {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--ink-2);
}

.totals strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--ink);
}

/* Conclusão */
.done {
  width: min(100%, 520px);
  margin: 10px auto 0;
  text-align: center;
}

.done-mark {
  position: relative;
  width: 104px;
  height: 104px;
  margin: 6px auto 16px;
}

.done-mark svg {
  width: 100%;
  height: 100%;
}

.done-mark circle {
  fill: var(--lime);
  transform-origin: center;
  animation: mark-pop 0.55s var(--spring) both;
}

.done-mark path {
  fill: none;
  stroke: var(--on-lime);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw 0.45s 0.35s var(--ease) forwards;
}

.done-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--lime);
  animation: ring 1.2s 0.2s var(--ease) both;
}

@keyframes mark-pop {
  from {
    transform: scale(0);
  }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes ring {
  from {
    transform: scale(0.8);
    opacity: 0.9;
  }

  to {
    transform: scale(1.7);
    opacity: 0;
  }
}

.done h1 {
  font-size: clamp(26px, 6vw, 32px);
}

.done > p {
  margin-top: 6px;
  color: var(--ink-2);
}

.door-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 16px;
  border-radius: 18px;
  text-align: left;
  background: rgba(12, 29, 74, 0.86);
  border: 1px solid var(--line-strong);
  animation: rise 0.5s 0.3s var(--ease) both;
}

.door-card.ok {
  border-color: var(--lime);
}

.door-card.failed {
  border-color: var(--danger);
}

.door-icon {
  position: relative;
  flex: none;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--lime);
  color: var(--on-lime);
}

.door-card.ok .door-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(200, 245, 66, 0.55);
  animation: door-pulse 1.6s ease-out infinite;
}

.door-card.ok .door-icon .icon {
  animation: unlock 0.7s 0.5s var(--spring) both;
}

.door-card.failed .door-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.door-card.neutral .door-icon {
  background: var(--card-3);
  color: var(--ink);
}

.door-card h2 {
  font-size: 16px;
}

.door-card p {
  color: var(--ink-2);
  font-size: 13.5px;
}

.door-card .btn {
  flex: none;
  margin-left: auto;
}

@media (max-width: 480px) {
  .door-card {
    flex-wrap: wrap;
  }

  .door-card > div:not(.door-icon) {
    flex: 1;
    min-width: 0;
  }

  .door-card .btn {
    width: 100%;
  }
}

@keyframes door-pulse {
  to {
    box-shadow: 0 0 0 18px rgba(200, 245, 66, 0);
  }
}

@keyframes unlock {
  from {
    transform: translateY(5px) rotate(-10deg);
    opacity: 0.4;
  }
}

.summary {
  margin-top: 14px;
  padding: 6px 16px;
  border-radius: 18px;
  background: rgba(12, 29, 74, 0.82);
  border: 1px solid var(--line);
  text-align: left;
  animation: rise 0.5s 0.42s var(--ease) both;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.summary-row:last-child {
  border-bottom: 0;
}

.summary-row strong {
  white-space: nowrap;
}

.due-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  text-align: left;
  background: var(--lime-soft);
  color: var(--lime);
  animation: rise 0.5s 0.5s var(--ease) both;
}

.due-box span {
  display: block;
  color: var(--ink-2);
  font-size: 13px;
}

.due-box strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
}

.done-actions {
  margin-top: 18px;
}

.confetti {
  position: fixed;
  z-index: 50;
  top: -14px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  pointer-events: none;
  animation: confetti-fall var(--dur) var(--delay) linear both;
}

@keyframes confetti-fall {
  to {
    transform: translate3d(var(--drift), 108vh, 0) rotate(var(--spin));
    opacity: 0.7;
  }
}
