/* GlassCard */

.glass {
  background: var(--glass-fill);
  border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: var(--glass-fallback);
  }
}

.card {
  position: relative;
  isolation: isolate;
  border-radius: var(--r-card);
  padding: clamp(1.1rem, 0.85rem + 1vw, 1.6rem);
}

.card::before {
  content: "";
  position: absolute;
  inset-inline: 16%;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.75), transparent);
  pointer-events: none;
}

[data-tilt] {
  transform: perspective(1100px) translateY(var(--lift, 0)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 520ms var(--ease-out);
}

[data-tilt]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  border-radius: inherit;
  box-shadow: var(--glow-teal);
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
  pointer-events: none;
}

[data-tilt]:hover {
  --lift: -4px;
}

[data-tilt]:hover::after,
[data-tilt]:focus-within::after {
  opacity: 1;
}

.spot {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
  pointer-events: none;
}

.spot::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.2), rgba(20, 227, 208, 0.06) 45%, transparent 68%);
  transform: translate(calc(var(--mx, 50%) - 190px), calc(var(--my, 50%) - 190px));
}

[data-tilt]:hover .spot {
  opacity: 1;
}

/* GradientButton and friends */

.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.35rem;
  border: 0;
  border-radius: var(--r-control);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
}

.btn-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  transition: opacity var(--dur-fast);
}

.btn-primary {
  color: var(--ink-on-brand);
  background: var(--grad-brand);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  box-shadow: 0 12px 34px -8px rgba(20, 227, 208, 0.7), 0 0 0 1px rgba(125, 211, 252, 0.45);
  opacity: 0.45;
  transition: opacity var(--dur) var(--ease-out);
}

.btn-fx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.btn-fx::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: -45%;
  width: 38%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: translateX(0) skewX(-18deg);
}

.btn-primary:hover::after,
.btn-primary:focus-visible::after {
  opacity: 1;
}

.btn-primary:hover .btn-fx::before,
.btn-primary:focus-visible .btn-fx::before {
  animation: shine 1s var(--ease-out);
}

.btn-primary[data-shine] .btn-fx::before {
  animation: shine 1.1s var(--ease-out) 1.2s, shine-idle 6s var(--ease-out) 2.4s infinite;
}

@keyframes shine {
  to {
    transform: translateX(-420%) skewX(-18deg);
  }
}

@keyframes shine-idle {
  0%,
  70% {
    transform: translateX(0) skewX(-18deg);
  }
  100% {
    transform: translateX(-420%) skewX(-18deg);
  }
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.97);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.btn-primary:disabled::after {
  opacity: 0;
}

.btn-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(3, 20, 29, 0.25);
  border-top-color: currentColor;
  opacity: 0;
  pointer-events: none;
}

.btn[data-loading] {
  cursor: progress;
  opacity: 1;
}

.btn[data-loading] .btn-label {
  opacity: 0;
}

.btn[data-loading] .btn-spinner {
  opacity: 1;
  animation: spin 0.75s linear infinite;
}

.btn-ghost {
  color: var(--ink);
  background: var(--glass-fill-flat);
  border: 1px solid var(--glass-edge);
}

.btn-ghost:hover {
  border-color: var(--glass-edge-bright);
}

.btn-ghost .btn-spinner,
.btn-danger .btn-spinner {
  border-color: rgba(234, 246, 251, 0.2);
  border-top-color: currentColor;
}

.btn-danger {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.08);
  border: 1px solid rgba(251, 113, 133, 0.35);
}

.btn-danger:hover {
  border-color: rgba(251, 113, 133, 0.6);
}

.btn-sm {
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 12px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid var(--glass-edge);
  border-radius: 12px;
  background: var(--glass-fill-flat);
  color: var(--ink);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out);
}

.icon-btn:active {
  transform: scale(0.94);
}

/* fields */

.field {
  position: relative;
  isolation: isolate;
}

.field::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--r-control);
  box-shadow: 0 0 0 4px rgba(20, 227, 208, 0.14), 0 0 28px -6px rgba(20, 227, 208, 0.6);
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
  pointer-events: none;
}

.field:focus-within::after {
  opacity: 1;
}

.field input,
.field select {
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 1.45rem 3.1rem 0.4rem 1rem;
  color: var(--ink);
  background: var(--well);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-control);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--dur-fast);
}

.field.has-toggle input {
  padding-left: 3.4rem;
}

.field input:focus,
.field select:focus {
  border-color: rgba(20, 227, 208, 0.75);
}

.field input:user-invalid {
  border-color: rgba(251, 113, 133, 0.6);
}

.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 100px #0b1d2d inset;
  caret-color: var(--ink);
}

.field label {
  position: absolute;
  top: 50%;
  right: 3.1rem;
  max-width: calc(100% - 4.5rem);
  overflow: hidden;
  color: var(--ink-faint);
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
  transform: translateY(-50%);
  transform-origin: right center;
  transition: transform var(--dur) var(--ease-out), color var(--dur-fast);
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field input:-webkit-autofill + label,
.field select + label {
  transform: translateY(calc(-50% - 0.8rem)) scale(0.78);
  color: var(--sky-soft);
}

.field-icon {
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 20px;
  height: 20px;
  color: var(--ink-faint);
  transform: translateY(-50%);
  pointer-events: none;
  transition: color var(--dur-fast);
}

.field:focus-within .field-icon {
  color: var(--teal);
}

.field-toggle {
  position: absolute;
  top: 50%;
  left: 0.4rem;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  transform: translateY(-50%);
}

.field-toggle:hover {
  color: var(--ink);
}

.field-toggle .eye-off,
.field-toggle[aria-pressed="true"] .eye-on {
  display: none;
}

.field-toggle[aria-pressed="true"] .eye-off {
  display: block;
}

.field-select select {
  appearance: none;
  padding-left: 2.8rem;
  cursor: pointer;
}

.field-select option {
  background: var(--night-1);
  color: var(--ink);
}

.field-chevron {
  position: absolute;
  top: 50%;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: var(--ink-faint);
  transform: translateY(-50%);
  pointer-events: none;
}

.field-hint {
  margin-top: 0.45rem;
  color: var(--ink-faint);
  font-size: var(--fs-small);
}

/* Badge and chip */

.badge {
  --tone: var(--tone-approved);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 30px;
  padding: 0.15rem 0.75rem;
  border-radius: var(--r-pill);
  border: 1px solid color-mix(in srgb, var(--tone) 40%, transparent);
  background: color-mix(in srgb, var(--tone) 11%, transparent);
  color: var(--tone);
  font-size: var(--fs-small);
  font-weight: 700;
  white-space: nowrap;
}

.badge .icon {
  width: 16px;
  height: 16px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.badge[data-status="pending"],
.badge[data-status="awaiting_receipt"],
.badge[data-status="depleted"] {
  --tone: var(--tone-pending);
}

.badge[data-status="pending"] .badge-dot,
.badge[data-status="awaiting_receipt"] .badge-dot {
  animation: blink 1.6s ease-in-out infinite;
}

.badge[data-status="rejected"],
.badge[data-status="expired"] {
  --tone: var(--tone-rejected);
}

.badge[data-status="featured"] {
  color: #fff;
  border-color: rgba(165, 180, 252, 0.55);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.55), rgba(56, 189, 248, 0.4));
  box-shadow: 0 6px 22px -6px rgba(99, 102, 241, 0.8);
}

@keyframes blink {
  50% {
    opacity: 0.3;
  }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 34px;
  padding: 0.2rem 0.75rem;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-dim);
  font-size: var(--fs-small);
}

.chip .icon {
  width: 16px;
  height: 16px;
  color: var(--sky-soft);
}

/* price */

.price {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-weight: 850;
  line-height: 1.2;
}

.price-num {
  display: inline-block;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.85rem);
  font-variant-numeric: tabular-nums;
}

.price-unit {
  color: var(--ink-dim);
  font-size: var(--fs-small);
  font-weight: 600;
}

/* Toast */

.toasts {
  position: fixed;
  z-index: 80;
  top: calc(var(--header-h) + 26px);
  inset-inline: 0;
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding-inline: 1rem;
  pointer-events: none;
}

.guest .toasts {
  top: 1.25rem;
}

.toast {
  --tone: var(--teal);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(100%, 420px);
  padding: 0.55rem 1rem 0.55rem 0.4rem;
  border-radius: 18px;
  border-color: color-mix(in srgb, var(--tone) 35%, transparent);
  pointer-events: auto;
  animation: toast-in 460ms var(--ease-spring) both;
}

.toast[data-tone="error"] {
  --tone: var(--rose);
}

.toast p {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.toast-icon {
  width: 22px;
  height: 22px;
  color: var(--tone);
  filter: drop-shadow(0 0 8px var(--tone));
}

.toast-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
}

.toast-close .icon {
  width: 18px;
  height: 18px;
}

.toast-timer {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: var(--tone);
  transform-origin: right center;
  animation: toast-timer 5.5s linear forwards;
}

.toast:hover .toast-timer,
.toast:focus-within .toast-timer {
  animation-play-state: paused;
}

.toast[data-leaving] {
  animation: toast-out 260ms var(--ease-out) both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.94);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
}

@keyframes toast-timer {
  to {
    transform: scaleX(0);
  }
}

/* Modal */

.modal {
  width: min(100% - 2rem, 440px);
  max-height: calc(100dvh - 2rem);
  padding: 1.25rem;
  border-radius: var(--r-card);
  border: 1px solid var(--glass-edge-bright);
  background: linear-gradient(160deg, rgba(22, 44, 66, 0.82), rgba(8, 20, 34, 0.9));
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.85), 0 0 60px -20px rgba(20, 227, 208, 0.45);
  color: var(--ink);
}

.modal::backdrop {
  background: rgba(2, 6, 12, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal[open] {
  animation: modal-in 380ms var(--ease-spring) both;
}

.modal[open]::backdrop {
  animation: fade-in 280ms var(--ease-out) both;
}

.modal[data-closing] {
  animation: modal-out 200ms var(--ease-out) both;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-head h2 {
  font-size: var(--fs-heading);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.93);
  }
}

@keyframes modal-out {
  to {
    opacity: 0;
    transform: scale(0.96);
  }
}

/* EmptyState */

.empty {
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  padding: clamp(2rem, 1.5rem + 3vw, 3.5rem) 1.5rem;
  text-align: center;
}

.empty p {
  max-width: 40ch;
  color: var(--ink-dim);
}

.empty .btn {
  margin-top: 0.6rem;
}

.empty-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin-bottom: 0.6rem;
  border-radius: 30px;
  border: 1px solid rgba(125, 211, 252, 0.4);
  background: radial-gradient(circle at 30% 20%, rgba(125, 211, 252, 0.28), rgba(20, 227, 208, 0.06) 62%);
  box-shadow: 0 0 44px -8px rgba(20, 227, 208, 0.55);
  color: var(--teal);
}

.empty-art .icon {
  width: 42px;
  height: 42px;
}

.empty-art::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px dashed rgba(125, 211, 252, 0.4);
  animation: spin 22s linear infinite;
}

/* Skeleton */

.skeleton {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(100%);
  animation: shimmer 1.3s ease-in-out infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(-100%);
  }
}

.sk-title {
  width: min(260px, 60%);
  height: 30px;
}

.sk-line {
  width: min(420px, 85%);
  height: 14px;
}

.sk-card {
  display: grid;
  gap: 0.9rem;
}

.sk-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}

.sk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sk-chip {
  width: 78px;
  height: 32px;
  border-radius: var(--r-pill);
}

.sk-block {
  height: 48px;
  border-radius: var(--r-control);
}

.sk-qr {
  width: 184px;
  height: 184px;
  border-radius: 20px;
  justify-self: center;
}

.sk-lines {
  display: grid;
  flex: 1;
  gap: 0.6rem;
  align-content: center;
}

.sk-tall {
  height: 42px;
}

.sk-w-30 {
  width: 30%;
}

.sk-w-40 {
  width: 40%;
}

.sk-w-45 {
  width: 45%;
}

.sk-w-55 {
  width: 55%;
}

.sk-w-100 {
  width: 100%;
}

.sk-ticket {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 880px) {
  .sk-ticket {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 2rem;
  }
}
