/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-black: #000000;
  --color-white: #ffffff;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  --color-primary: #000000;
  --color-primary-hover: #1a1a1a;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
}

@font-face {
  font-family: 'Daylight';
  src: url('/assets/fonts/Daylight.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

html {
  scrollbar-gutter: stable;
  overflow-x: clip;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-black);
  background-color: var(--color-white);
  transition: background-color 0.4s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

body.bg-premium-visible {
  background-color: var(--color-black);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5em;
}

h1 { font-size: clamp(28px, 8vw, 120px); }
h2 { font-size: clamp(24px, 5vw, 48px); }
h3 { font-size: clamp(18px, 3vw, 32px); }

p {
  margin-bottom: 1em;
}

.font-typewriter {
  font-family: var(--font-mono);
}

/* Layout */
.main-content {
  min-height: 100vh;
  min-height: 100dvh;
}

.page-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

@media (min-width: 640px) {
  .page-container {
    padding: 3rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .page-container {
    padding: 4rem 2rem;
  }
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-black);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

.btn-large {
  padding: 1rem 1.5rem;
  font-size: 1rem;
}

.btn-secondary {
  background-color: var(--color-white);
  color: var(--color-black);
  border: 1px solid var(--color-gray-300);
}

.btn-secondary:hover {
  background-color: var(--color-gray-50);
}

.btn-login {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  background-color: transparent;
  color: var(--color-black);
  border: none;
  border-radius: 0;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-login:hover {
  opacity: 0.7;
}

button:disabled,
.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.loading {
  position: relative;
  color: transparent;
}

button.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Login Button (in grid header) */
.site-header .login-button-container {
  position: static;
  grid-column: 3;
  justify-self: end;
  min-width: 0;
  max-width: 100%;
}

.site-header .btn-login {
  max-width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.65rem;
  font-size: 0.8125rem;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

@media (min-width: 640px) {
  .site-header .btn-login {
    min-height: 40px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    white-space: nowrap;
  }
}

.back-button-container {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: calc(16px + env(safe-area-inset-left, 0px));
  z-index: 1000;
}

@media (min-width: 640px) {
  .back-button-container {
    top: calc(20px + env(safe-area-inset-top, 0px));
    left: calc(20px + env(safe-area-inset-left, 0px));
  }
}

@media (min-width: 1024px) {
  .back-button-container {
    top: calc(24px + env(safe-area-inset-top, 0px));
    left: calc(24px + env(safe-area-inset-left, 0px));
  }
}

.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  background-color: transparent;
  color: var(--color-black);
  border: none;
  border-bottom: 1px solid var(--color-black);
  border-radius: 0;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}

.btn-back:hover {
  border-bottom-width: 2px;
  opacity: 0.7;
}

/* Hero Section - 1st section, full viewport */
.hero-section {
  min-height: 100vh;
  height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  padding-left: calc(1rem + env(safe-area-inset-left, 0px));
  padding-right: calc(1rem + env(safe-area-inset-right, 0px));
  position: relative;
  overflow: hidden;
}

.hero-container {
  max-width: 1600px;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 3rem;
  padding-top: 0;
}

/* Hero card - fills 100vh section, centered via grid */
.hero-card-container {
  flex: 1;
  display: grid;
  place-items: center;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  height: 100%;
  perspective: 1200px;
  margin-top: calc(-6% - 40px);
  position: relative;
}

.hero-card-video-wrap {
  display: block;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

@media (max-width: 639px) {
  .hero-card-video-wrap {
    max-width: 100%;
    width: min(100%, 100vw - 1rem);
  }

  .hero-container {
    gap: 1.25rem;
    padding: 0 0.5rem;
  }

  .hero-card-container {
    margin-top: calc(-2% - 16px);
  }
}

.hero-card-video {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  background: transparent;
}

/* Hero USPs — three-column strip under hero */
.hero-usps-section {
  position: relative;
  padding-top: 0;
  padding-bottom: clamp(2rem, 4.5vw, 3.5rem);
  padding-left: calc(1rem + env(safe-area-inset-left, 0px));
  padding-right: calc(1rem + env(safe-area-inset-right, 0px));
  background-color: var(--color-white);
}

.hero-usps__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.hero-usps-container {
  max-width: 1320px;
  margin: 0 auto;
}

.hero-usps-grid {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(0.5rem, 1.25vw, 1rem);
}

.hero-usp-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 clamp(0.5rem, 1.5vw, 1rem);
}

.hero-usp-card__visual {
  width: 100%;
  max-width: min(100%, 375px);
  aspect-ratio: 1 / 1;
  margin-bottom: 1.5rem;
  border: none;
  outline: none;
  box-shadow: none;
  border-radius: 0;
  background-color: transparent;
  flex-shrink: 0;
  overflow: hidden;
}

.hero-usp-card__visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
}

.hero-usp-card__visual:empty {
  display: none;
}

.hero-usp-card__title {
  font-size: clamp(0.8125rem, 1.35vw, 0.9375rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.35;
  margin: 0 0 0.65rem;
  color: var(--color-black);
}

.hero-usp-card__copy {
  font-size: clamp(12px, 2.1vw, 14px);
  line-height: 1.55;
  color: var(--color-gray-600);
  margin: 0;
  max-width: 28ch;
}

@media (max-width: 767px) {
  .hero-usps-grid {
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
  }

  .hero-usp-card {
    max-width: min(100%, 28rem);
    width: 100%;
    padding: 1.25rem 0;
  }

  .hero-usp-card__visual {
    max-width: 100%;
    aspect-ratio: 1 / 1;
  }
}

.hero-card-3d {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-card-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.hero-card-loading.loaded {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease-out;
}

.hero-card-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.hero-card-loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--color-black, #000);
  border-radius: 50%;
  animation: hero-card-spin 0.8s linear infinite;
}

.hero-card-loader-text {
  font-size: 0.75rem;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gray-500, #6b7280);
}

@keyframes hero-card-spin {
  to { transform: rotate(360deg); }
}

.hero-card-canvas {
  width: 100%;
  height: 100%;
  min-height: 400px;
  display: block;
}

@media (min-width: 640px) {
  .hero-card-3d {
    min-height: 500px;
  }
}

@media (min-width: 1024px) {
  .hero-card-3d {
    min-height: 600px;
  }
  .hero-card-container {
    margin-top: calc(-6% - 40px);
  }
}

/* Site header - Logo, Tabs, Login (1fr | auto | 1fr keeps nav at true viewport center) */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 0.35rem;
  padding: 12px calc(12px + env(safe-area-inset-right, 0px)) 12px calc(12px + env(safe-area-inset-left, 0px));
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  z-index: 150;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
}

.site-header .sticky-logo-link {
  grid-column: 1;
  justify-self: start;
  min-width: 0;
}

.site-header .header-tabs {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: max-content;
  max-width: 100%;
  min-width: 0;
}

@media (min-width: 640px) {
  .site-header {
    column-gap: 0.5rem;
    padding: 16px calc(20px + env(safe-area-inset-right, 0px)) 16px calc(20px + env(safe-area-inset-left, 0px));
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
  }
}

@media (min-width: 1024px) {
  .site-header {
    padding: 16px calc(24px + env(safe-area-inset-right, 0px)) 16px calc(24px + env(safe-area-inset-left, 0px));
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
  }
}

/*
 * Order flow header: fixed below site chrome so scrolled content never rides into the status bar.
 * (position: sticky is unreliable here because html/body use overflow-x: clip.)
 */
.site-header.order-page-header {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  grid-template-columns: unset;
  gap: 0;
  padding: 12px 16px;
  padding-bottom: 14px;
  padding-left: calc(16px + env(safe-area-inset-left, 0px));
  padding-right: calc(16px + env(safe-area-inset-right, 0px));
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  z-index: 200;
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
}

/* Offset main so first paint isn’t hidden under the fixed bar (matches header block height + safe area) */
main.main-content:has(.order-page) {
  padding-top: calc(3.5rem + env(safe-area-inset-top, 0px));
}

.site-header.order-page-header .sticky-logo-link,
.site-header.order-page-header .header-tabs,
.site-header.order-page-header .login-button-container {
  grid-column: auto;
}

.header-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-tab {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-gray-600);
  text-decoration: none;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.35rem 0.4rem;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 640px) {
  .header-tab {
    font-size: 0.875rem;
    min-height: 40px;
    padding: 0.25rem 0.5rem;
  }
}

.header-tab:hover,
.header-tab.active {
  color: var(--color-black);
}

.header-tab-sep {
  font-size: 0.875rem;
  color: var(--color-gray-400);
  display: inline-flex;
  align-items: center;
  align-self: center;
  user-select: none;
}

.sticky-logo-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-black);
}

.sticky-logo-text {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

@media (max-width: 639px) {
  .sticky-logo-text {
    display: none; /* Mobile: logo symbol only */
  }
}

.sticky-logo-img {
  height: 24px;
  width: auto;
  display: block;
}

@media (min-width: 640px) {
  .sticky-logo-img {
    height: 26px;
  }
}

/* Mustache Container */
.mustache-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2rem;
  min-height: 200px;
  perspective: 1000px;
}

.mustache-wrapper {
  position: relative;
  width: 100%;
  max-width: min(92vw, 400px);
  aspect-ratio: 4 / 3;
  height: auto;
}

@media (min-width: 640px) {
  .mustache-wrapper {
    max-width: 450px;
    aspect-ratio: unset;
    height: 337px;
  }
}

@media (min-width: 1024px) {
  .mustache-wrapper {
    max-width: 700px;
    height: 525px;
  }
}

.stamp-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 0;
  transform: scale(0.35) translateX(-20%);
  transform-origin: center;
}

.mustache-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 10;
  transition: opacity 0.1s;
}

/* Hero CTA — fixed to viewport; pointer-events none so footer/links below scroll
   remain clickable; interactive children opt back in */
.hero-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem calc(1rem + env(safe-area-inset-right, 0px)) calc(1.5rem + env(safe-area-inset-bottom, 0px)) calc(1rem + env(safe-area-inset-left, 0px));
  z-index: 100;
  width: 100%;
  pointer-events: none;
}

.hero-cta a,
.hero-cta button {
  pointer-events: auto;
}

.hero-cta-subtitle {
  font-size: 14px;
  color: var(--color-gray-500);
  font-family: var(--font-mono);
}

/* Scroll invite — bottom of Story hero; links to #story (Mustachism Codex) */
.story-hero {
  position: relative;
}

.hero-scroll-invite--story {
  position: absolute;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  margin-bottom: 0;
  z-index: 10;
}

.hero-scroll-invite {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--color-gray-700);
  transition: opacity 0.4s ease, visibility 0.4s ease, color 0.2s ease;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.85));
}

.hero-scroll-invite:hover,
.hero-scroll-invite:focus-visible {
  color: var(--color-black);
}

.hero-scroll-invite:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 4px;
}

.hero-scroll-invite__label {
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-gray-600);
}

.hero-scroll-invite:hover .hero-scroll-invite__label,
.hero-scroll-invite:focus-visible .hero-scroll-invite__label {
  color: var(--color-black);
}

.hero-scroll-invite__arrow {
  display: flex;
  color: var(--color-gray-700);
  animation: hero-scroll-invite-bob 2.2s ease-in-out infinite;
}

.hero-scroll-invite:hover .hero-scroll-invite__arrow,
.hero-scroll-invite:focus-visible .hero-scroll-invite__arrow {
  color: var(--color-black);
}

@keyframes hero-scroll-invite-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-scroll-invite__arrow {
    animation: none;
  }
}

/* Sticky CTA */
.sticky-cta {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--color-white);
  z-index: 999;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) calc(1rem + env(safe-area-inset-right, 0px)) 1rem calc(1rem + env(safe-area-inset-left, 0px));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sticky-cta.hidden {
  display: none;
}

.sticky-cta-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.sticky-cta-subtitle {
  font-size: 1rem;
  color: var(--color-gray-500);
  font-family: var(--font-mono);
}

/* Card Section */
.card-section {
  padding: 4rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  perspective: 1000px;
}

.card-wrapper {
  width: 100%;
  max-width: 70%;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
}

@media (min-width: 640px) {
  .card-wrapper {
    max-width: 400px;
  }
}

@media (min-width: 1024px) {
  .card-wrapper {
    max-width: 600px;
  }
}

.license-card-preview {
  width: 100%;
  aspect-ratio: 500 / 310;
  background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.license-card-content {
  text-align: center;
  color: var(--color-white);
}

.license-number-preview {
  font-size: clamp(24px, 4vw, 48px);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.license-preview-text {
  font-size: clamp(14px, 2vw, 20px);
  opacity: 0.8;
}

/* Mustachism Codex Section */
#story {
  scroll-margin-top: calc(4.5rem + env(safe-area-inset-top, 0px));
}

.codex-section {
  padding: 6rem 1rem;
  background-color: var(--color-white);
}

.codex-container {
  max-width: 1040px;
  margin: 0 auto;
}

.codex-title {
  text-align: center;
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 700;
  margin-bottom: 4rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.codex-content {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.codex-item {
  display: flex;
  gap: 2rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--color-gray-200);
  position: relative;
}

.codex-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Codex entries with illustration (e.g. point 1) */
.codex-item--with-art {
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 1.75rem;
}

.codex-item--with-art > .codex-text {
  flex: 1;
  min-width: 0;
}

.codex-figure {
  margin: 0;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #0a0a0a;
  line-height: 0;
  align-self: center;
  max-width: min(100%, 440px);
  width: 100%;
}

.codex-figure__img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

.codex-figure__video {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

.codex-figure--video {
  background: #0a0a0a;
}

.codex-figure--video .codex-figure__mobile-static {
  display: none;
}

@media (max-width: 839px) {
  .codex-figure--video .codex-figure__video {
    display: none !important;
  }

  .codex-figure--video .codex-figure__mobile-static {
    display: block;
    width: 100%;
    height: auto;
  }
}

@media (min-width: 840px) {
  .codex-item--with-art .codex-figure__video {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .codex-item--with-art {
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    gap: clamp(1.75rem, 4vw, 3rem);
  }

  .codex-item--with-art .codex-figure {
    align-self: center;
    max-width: none;
    width: auto;
    flex: 0 0 clamp(300px, 40vw, 440px);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .codex-item--with-art .codex-figure__img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
}

.codex-text {
  flex: 1;
}

.codex-commandment-head {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(0.65rem, 2vw, 1rem);
  margin-bottom: 0.75rem;
}

.codex-commandment-head .codex-commandment {
  flex: 1;
  min-width: 0;
}

.codex-commandment-head .codex-commandment__n {
  flex-shrink: 0;
}

.codex-commandment__sr-only {
  border: 0;
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap;
}

.codex-commandment {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  color: var(--color-black);
}

.codex-commandment__n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 2px solid var(--color-black);
  background-color: var(--color-white);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(15px, 1.35vw, 18px);
  color: var(--color-black);
  line-height: 1;
}

.codex-commandment__n--wide {
  width: 3.125rem;
  min-width: 3.125rem;
  font-size: clamp(13px, 1.15vw, 16px);
}

.codex-text p {
  font-size: clamp(14px, 1.8vw, 16px);
  line-height: 1.7;
  color: var(--color-gray-600);
  font-family: var(--font-mono);
  margin: 0;
}

@media (min-width: 768px) {
  .codex-item {
    gap: 3rem;
  }
}

/* Video Section */
.video-section {
  padding: 6.5rem 1.25rem 8rem;
  background-color: var(--color-white);
  transition: background-color 1.1s ease;
}

@media (min-width: 768px) {
  .video-section {
    padding: 8rem 2rem 9rem;
  }
}

.video-section-heading {
  transition: color 1.1s ease;
}

body.story-video-in-view .video-section .video-section-heading {
  color: var(--color-white);
}

/* Story page: ambient white → black when the video play overlay is scrolled into view */
body.story-video-in-view {
  background-color: var(--color-black);
  transition: background-color 1.1s ease;
}

body.story-video-in-view .video-section {
  background-color: var(--color-black);
}

body.story-video-in-view .footer-content {
  border-top-color: var(--color-gray-600);
}

.video-container {
  max-width: 1200px;
  margin: 0 auto;
}

.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--color-black);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

/* Story: scroll-driven scale + opacity (values set in JS) */
.video-wrapper--story-scroll {
  transform-origin: center center;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.mustache-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 10;
  transition: background-color 0.3s;
}

.video-play-overlay:hover {
  background-color: rgba(0, 0, 0, 0.4);
}

.video-play-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s;
}

.video-play-button:hover {
  transform: scale(1.1);
}

.video-play-button:active {
  transform: scale(0.95);
}

/* Presentation Box Section - 2nd section, above What Is a Mustache License */
.presentation-box-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  background: transparent;
}

.box-sequence-section {
  display: block;
  padding: 0;
  overflow: clip;
}

.box-sequence-scroll {
  position: relative;
  height: 240vh;
}

.box-sequence-sticky {
  position: sticky;
  top: 0;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
}

.presentation-box-container {
  position: relative;
  width: 100%;
  max-width: 1039px;
  margin: 0 auto;
  padding: 0 16px;
}

.price-badge-overlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.price-badge-svg {
  width: 120px;
  height: 120px;
}

.price-badge-rotate {
  transform-origin: 50% 50%;
  animation: price-badge-rotate 20s linear infinite;
}

@keyframes price-badge-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.presentation-box-img {
  width: 100%;
  height: auto;
  max-height: 655px;
  object-fit: contain;
  display: block;
}

.box-sequence-frame {
  opacity: 0;
  transition: opacity 0.2s ease-out;
  user-select: none;
  -webkit-user-drag: none;
}

.box-sequence-frame.is-ready {
  opacity: 1;
}

.presentation-box-middle {
  padding: 4rem 1rem;
  background: transparent;
  width: 100%;
}

/* Scroll sequence middle: keep outer track flush like first box-sequence (avoid .presentation-box-middle padding) */
.presentation-box-middle.box-sequence-section {
  padding: 0;
}

/* Scroll sequence premium (Box3): black stage + same outer track as other sequences */
.presentation-box-premium.box-sequence-section {
  padding: 0;
  overflow: visible;
  background-color: var(--color-black);
}

.presentation-box-premium .box-sequence-scroll,
.presentation-box-premium .box-sequence-sticky {
  background-color: var(--color-black);
}

.presentation-box-premium {
  padding: 2rem 1rem 4rem;
  width: 100%;
}

.presentation-box-premium .presentation-box-container {
  max-width: 900px;
}

/* First box sequence: smaller frames (same scroll track / container widths) */
.presentation-box-section.box-sequence-section:not(.presentation-box-middle):not(.presentation-box-premium) .box-sequence-frame {
  transform: scale(0.62);
  transform-origin: center center;
}

/* Second (middle) box sequence: smaller frames */
.presentation-box-middle .box-sequence-frame {
  transform: scale(0.62);
  transform-origin: center center;
}

/* Last sequence: larger frames without changing container / scroll track size */
.presentation-box-premium .box-sequence-frame {
  transform: scale(1.1);
  transform-origin: center center;
}

@media (max-width: 767px) {
  .box-sequence-scroll {
    height: 210vh;
  }

  /* Larger PNG/WebP sequences on phones (desktop uses scale 0.62) */
  .presentation-box-section.box-sequence-section:not(.presentation-box-middle):not(.presentation-box-premium) .box-sequence-frame {
    transform: scale(0.92);
  }

  .presentation-box-middle .box-sequence-frame {
    transform: scale(0.92);
  }

  .presentation-box-premium .box-sequence-frame {
    transform: scale(1.28);
  }

  .presentation-box-container {
    padding: 0 8px;
  }

  .box-sequence-sticky {
    padding: 2.5rem 0.5rem;
    min-height: 100dvh;
    min-height: 100vh;
  }

  .price-badge-svg {
    width: 132px;
    height: 132px;
  }

  .presentation-box-img {
    max-height: min(72vh, 720px);
    max-height: min(72dvh, 720px);
  }
}

@media (max-width: 480px) {
  .presentation-box-section.box-sequence-section:not(.presentation-box-middle):not(.presentation-box-premium) .box-sequence-frame {
    transform: scale(1);
  }

  .presentation-box-middle .box-sequence-frame {
    transform: scale(1);
  }

  .presentation-box-premium .box-sequence-frame {
    transform: scale(1.38);
  }

  .price-badge-svg {
    width: 144px;
    height: 144px;
  }
}

/* Content Section */
.content-section {
  padding: 4rem 1rem;
}

.content-container {
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  #what-is-license .content-container,
  .faq-section .faq-container {
    max-width: 900px;
  }
}

.content-container h2 {
  text-align: center;
  margin-bottom: 3rem;
  padding: 0 1rem;
  font-size: clamp(18px, 2.5vw, 28px);
}

.content-text {
  max-width: none;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

.content-text p {
  font-size: 16px;
  color: var(--color-gray-500);
  font-family: var(--font-mono);
  margin-bottom: 1.5rem;
}

/* FAQ Section */
.faq-section {
  padding: 4rem 1rem;
}

.faq-container {
  max-width: 1200px;
  margin: 0 auto;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.faq-item {
  border-bottom: 1px solid var(--color-gray-200);
  padding-bottom: 1rem;
}

.faq-question {
  font-size: clamp(16px, 2vw, 24px);
  margin-bottom: 0;
  cursor: pointer;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding-right: 2rem;
  user-select: none;
  transition: color 0.2s;
}

.faq-question:hover {
  color: var(--color-gray-600);
}

.faq-question::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  font-size: 1.5em;
  font-weight: 300;
  transition: transform 0.3s;
}

.faq-item.active .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, margin-top 0.3s ease-out;
  margin-top: 0;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  margin-top: 0.5rem;
}

.faq-item p {
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: var(--color-gray-500);
  font-family: var(--font-mono);
  margin-bottom: 0;
}

/* Legal pages (Privacy, Terms): clear fixed site header */
body:has(> .site-header:not(.order-page-header)) > .main-content > section.legal-page:first-child,
body:has(> .site-header:not(.order-page-header)) > .main-content > section.content-section.legal-page:first-child {
  padding-top: calc(5rem + env(safe-area-inset-top, 0px));
}

@media (min-width: 640px) {
  body:has(> .site-header:not(.order-page-header)) > .main-content > section.legal-page:first-child,
  body:has(> .site-header:not(.order-page-header)) > .main-content > section.content-section.legal-page:first-child {
    padding-top: calc(5.25rem + env(safe-area-inset-top, 0px));
  }
}

/* Legal pages (Privacy, Terms) */
.legal-page h1 {
  text-align: center;
  margin-bottom: 0.5rem;
  padding: 0 1rem;
  font-size: clamp(18px, 2.5vw, 28px);
  font-family: var(--font-mono);
}

.legal-updated {
  text-align: center;
  color: var(--color-gray-500);
  font-size: 14px;
  margin-bottom: 2.5rem;
  font-family: var(--font-mono);
}

.legal-body {
  max-width: 720px;
  margin: 0 auto;
  overflow-wrap: anywhere;
}

.legal-body h2 {
  font-size: 16px;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  color: var(--color-gray-700);
  font-weight: 600;
}

.legal-body h2:first-of-type {
  margin-top: 0;
}

.legal-body ul {
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
  color: var(--color-gray-500);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

.legal-body li {
  margin-bottom: 0.5rem;
}

.legal-body a {
  color: var(--color-gray-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-body a:hover {
  color: var(--color-gray-900);
}

/* Footer */
.footer {
  padding: 2rem 1rem 1rem;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--color-gray-200);
  transition: border-color 1.1s ease;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.footer-copyright {
  font-size: 0.875rem;
  color: var(--color-gray-500);
  text-align: center;
}

@media (min-width: 768px) {
  .footer-copyright {
    text-align: left;
  }
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .footer-links {
    justify-content: flex-end;
  }
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--color-gray-500);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--color-black);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
}

/* Flow Navigation */
.flow-navigation {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-family: var(--font-mono);
  margin: 0;
}

.nav-link {
  color: var(--color-gray-600);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--color-black);
  text-decoration: underline;
}

.nav-separator {
  color: var(--color-gray-400);
}

.nav-current {
  color: var(--color-black);
  font-weight: 600;
}

/* Step Indicator */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.step-indicator-top {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--color-white);
  margin-bottom: 0;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) calc(0.5rem + env(safe-area-inset-right, 0px)) 1rem calc(0.5rem + env(safe-area-inset-left, 0px));
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--color-gray-300);
  background-color: var(--color-white);
  color: var(--color-gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s;
}

.step-item.completed .step-number {
  background-color: var(--color-black);
  border-color: var(--color-black);
  color: var(--color-white);
}

.step-item.active .step-number {
  background-color: var(--color-black);
  border-color: var(--color-black);
  color: var(--color-white);
  transform: scale(1.1);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.1);
}

.step-label {
  font-size: 0.75rem;
  color: var(--color-gray-500);
  font-family: var(--font-mono);
  text-align: center;
  white-space: nowrap;
}

.step-item.completed .step-label,
.step-item.active .step-label {
  color: var(--color-black);
  font-weight: 600;
}

.step-connector {
  width: 60px;
  height: 2px;
  background-color: var(--color-gray-300);
  margin: 0 1rem;
  transition: background-color 0.3s;
}

.step-connector.completed {
  background-color: var(--color-black);
}

@media (max-width: 640px) {
  .step-indicator:not(.step-indicator-top) {
    padding: 1rem 0;
  }

  .step-indicator-top {
    padding: calc(0.75rem + env(safe-area-inset-top, 0px)) calc(0.5rem + env(safe-area-inset-right, 0px)) 0.75rem calc(0.5rem + env(safe-area-inset-left, 0px));
  }
  
  .step-number {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
  
  .step-label {
    font-size: 0.625rem;
  }
  
  .step-connector {
    width: 30px;
    margin: 0 0.5rem;
  }
}

/* Page Header */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--color-gray-500);
  font-family: var(--font-mono);
}

/* Filters */
/* Search Container */
.search-container {
  max-width: 600px;
  margin: 0 auto 2rem;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-gray-300);
  border-radius: 4px;
  font-size: 1rem; /* 16px: avoids iOS zoom on focus */
  font-family: var(--font-mono);
  color: var(--color-black);
  background-color: var(--color-white);
  transition: border-color 0.2s;
}

@media (min-width: 640px) {
  .search-input {
    font-size: 0.875rem;
  }
}

.search-input:focus {
  outline: none;
  border-color: var(--color-black);
}

.search-input::placeholder {
  color: var(--color-gray-400);
}

.filters-wrapper {
  width: 100%;
  margin-bottom: 2rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--color-gray-300) transparent;
}

.filters-wrapper::-webkit-scrollbar {
  height: 6px;
}

.filters-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.filters-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--color-gray-300);
  border-radius: 3px;
}

.filters-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-gray-400);
}

.filters {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-start;
  flex-wrap: nowrap;
  min-width: max-content;
  padding-bottom: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-gray-300);
  background-color: var(--color-white);
  color: var(--color-black);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.8125rem;
  white-space: nowrap;
  font-family: var(--font-mono);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 640px) {
  .filter-btn {
    min-height: 36px;
  }
}

.filter-btn:hover {
  background-color: var(--color-gray-50);
}

.filter-btn.active {
  background-color: var(--color-black);
  color: var(--color-white);
  border-color: var(--color-black);
}

/* License Grid */
.license-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .license-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

.license-card {
  position: relative;
  padding: 1.5rem;
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background-color: var(--color-white);
}

.license-card:hover {
  border-color: var(--color-black);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.license-card.available {
  cursor: pointer;
}

.license-card.unavailable {
  opacity: 0.5;
  cursor: not-allowed;
}

.license-card-number {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.license-card-price {
  font-size: 1rem;
  color: var(--color-gray-600);
  margin-bottom: 0.5rem;
}

.license-card-category {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background-color: var(--color-gray-100);
  color: var(--color-gray-700);
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 4px;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.license-card-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background-color: var(--color-black);
  color: var(--color-white);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  margin-top: 0.5rem;
}

.license-card-status {
  font-size: 0.75rem;
  color: var(--color-gray-500);
  margin-top: 0.5rem;
  text-transform: capitalize;
}

/* Load More */
.load-more-container {
  text-align: center;
  margin-top: 2rem;
}

.hidden {
  display: none !important;
}

/* Loading/Empty/Error States */
.loading-state,
.empty-state,
.error-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-gray-500);
}

.error-state {
  color: #dc2626;
}

/* Auth Pages */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 2rem 1rem;
}

.auth-card {
  max-width: 400px;
  width: 100%;
  background-color: var(--color-white);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.75rem;
  width: 100%;
}

.auth-logo-link {
  display: inline-flex;
  line-height: 0;
}

.auth-logo-img {
  height: 24px;
  width: auto;
  display: block;
}

@media (min-width: 640px) {
  .auth-logo-img {
    height: 26px;
  }
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-gray-500);
}

.auth-footer a {
  color: var(--color-black);
  text-decoration: underline;
}

/* Form Styles */
.form-preview-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .form-preview-container {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.form-section {
  order: 2;
}

@media (min-width: 1024px) {
  .form-section {
    order: 1;
  }
}

.license-preview-section {
  order: 1;
  position: sticky;
  top: 100px;
  background-color: var(--color-white);
  padding: 1rem;
  border-radius: 8px;
}

@media (max-width: 1023px) {
  .license-preview-section {
    top: calc(5.5rem + env(safe-area-inset-top, 0px));
  }
}

@media (min-width: 1024px) {
  .license-preview-section {
    order: 2;
    top: 100px;
  }
}

.preview-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
  font-family: var(--font-mono);
}

@media (min-width: 1024px) {
  .preview-title {
    text-align: left;
  }
}

.license-card-live-preview {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  background-color: transparent;
}

.license-info {
  margin-top: 1.5rem;
  text-align: center;
}

.license-info .form-subtitle,
.license-info .form-price {
  margin: 0.5rem 0;
  font-size: 0.875rem;
  font-family: var(--font-mono);
}

.license-card-wrapper {
  position: relative;
  width: 100%;
  min-height: 200px;
  aspect-ratio: 1232 / 767;
  background: none;
  overflow: hidden;
  border-radius: 10px;
}

/* Order page: license card enters from the right (off-screen) */
.order-page .license-card-wrapper {
  animation: order-license-card-enter 0.95s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes order-license-card-enter {
  from {
    opacity: 0;
    transform: translate3d(105vw, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .order-page .license-card-wrapper {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.license-background {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background-color: transparent;
  background-image: none;
}

.license-card-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Order page: soft periodic shimmer over the fallback card (~6s cycle) */
.license-card-shimmer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.license-card-shimmer::before {
  content: '';
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Wide diagonal band; animating background-position sweeps it across the entire card (BL→TR) */
  background: linear-gradient(
    127deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 36%,
    rgba(255, 255, 255, 0.14) 43%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0.14) 57%,
    rgba(255, 255, 255, 0) 64%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 280% 280%;
  background-position: 0% 100%;
  background-repeat: no-repeat;
  filter: blur(18px);
  opacity: 0;
  animation: license-card-shimmer-pass 6s ease-in-out infinite;
  will-change: background-position, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .license-card-shimmer::before {
    animation: none;
    opacity: 0;
  }
}

@keyframes license-card-shimmer-pass {
  0%,
  10% {
    background-position: 0% 100%;
    opacity: 0;
  }
  22% {
    opacity: 1;
  }
  48% {
    background-position: 100% 0%;
    opacity: 0.88;
  }
  58%,
  100% {
    background-position: 100% 0%;
    opacity: 0;
  }
}

.license-card-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: none; /* Use 2D template image (license-back.png) as card visual */
}

.license-card-3d-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Figma-aligned overlay typography (OCR-B, rgba(0,0,0,0.8), text-shadow) */
.license-overlay {
  position: absolute;
  font-family: 'OCR-B', 'OCR B', 'Courier New', monospace;
  font-weight: normal;
  color: rgba(0, 0, 0, 0.8);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95);
  font-size: 14px;
  line-height: normal;
  letter-spacing: 0;
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2em;
  z-index: 2;
}

.license-overlay-title {
  font-family: var(--font-sans);
  font-size: 0.5em;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  line-height: 1.1;
}

.license-overlay-value {
  font-family: inherit;
  font-size: 1em;
  line-height: 1.15;
  min-height: 1.15em;
}

/* Order page: card preview always shows every field (titles + value row); overrides display:none on overlay classes */
.order-page .license-card-wrapper--order > .license-overlay {
  display: flex !important;
}

.order-page .license-card-wrapper--order > .license-photo-overlay {
  display: flex !important;
  top: 20.5%;
}

.order-page .license-photo-overlay:not(.license-photo-overlay--empty) .license-photo-placeholder {
  display: none !important;
}

.license-photo-placeholder {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-family: 'OCR-B', 'OCR B', 'Courier New', monospace;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

/* Order card: empty photo slot matches other overlay text (not a light/white panel) */
.order-page .license-photo-overlay--empty .license-photo-overlay-frame {
  background-color: rgba(0, 0, 0, 0.14);
  border-color: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.15);
}

.order-page .license-photo-overlay--empty .license-photo-placeholder {
  display: flex !important;
  color: rgba(0, 0, 0, 0.8);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95);
}

/* License title — upper area, shifted left and slightly below previous alignment */
.license-number-overlay {
  left: 9%;
  right: auto;
  top: 5.8%;
  max-width: 88%;
  transform: translateY(2px);
  display: none;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 0.35em;
  text-align: left;
  white-space: nowrap;
}

.license-number-overlay .license-overlay-title,
.license-number-overlay .license-overlay-value {
  width: auto;
  text-align: left;
}

/* Same size as other .license-overlay-value rows (inherits 14px from .license-overlay) */
.license-number-overlay .license-number-heading,
.license-number-overlay .license-number-value {
  font-family: inherit;
  font-size: 1em;
  font-weight: normal;
  letter-spacing: 0;
  line-height: 1.15;
  min-height: 1.15em;
  color: rgba(0, 0, 0, 0.8);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95);
}

.license-number-overlay .license-number-heading {
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.license-prefix-overlay {
  left: 37.4%;
  top: 20.5%;
  display: none;
}

.license-firstname {
  left: 46.2%;
  top: 20.5%;
  text-align: left;
  max-width: 45%;
  display: none;
}

.license-sex-overlay {
  left: 37.4%;
  top: 38.2%;
  text-align: left;
  display: none;
}

.license-dob-overlay {
  left: 46.2%;
  top: 38.2%;
  text-align: left;
  display: none;
}

.license-issue-date-overlay {
  left: 37.4%;
  top: 54.8%;
  text-align: left;
  display: none;
}

.license-exp-overlay {
  left: 37.4%;
  top: 70.5%;
  text-align: left;
  display: flex;
}

.license-valid-overlay {
  left: 56%;
  top: 70.5%;
  text-align: left;
  display: flex;
}

.license-type-overlay {
  left: 88.3%;
  top: 86%;
  font-size: 18px;
  text-align: center;
  transform: translate(-50%, -6px);
  display: none;
  align-items: center;
}

/* Class letter — Daylight font only; color/shadow match other license overlay values (debossed metal) */
.license-type-overlay .license-overlay-value,
#preview-type-text {
  font-family: 'Daylight', var(--font-sans);
  font-weight: normal;
  font-size: 1.65em;
  letter-spacing: 0.02em;
  line-height: 1;
  color: rgba(0, 0, 0, 0.8);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95);
}

.license-email-overlay {
  top: 67%;
  left: 8%;
  font-size: 12px;
  color: rgba(148, 148, 148, 0.8);
  opacity: 0.8;
  letter-spacing: 0.02em;
}

.license-photo-overlay {
  position: absolute;
  left: 4.3%;
  top: 17.5%;
  width: 28.6%;
  height: 60%;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  background-color: transparent;
  z-index: 10;
  box-shadow: none;
}

.license-photo-overlay-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background-color: var(--color-gray-100);
  box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.05);
}

.license-photo-overlay img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: grayscale(100%) contrast(200%) brightness(0.85);
  -webkit-filter: grayscale(100%) contrast(200%) brightness(0.85);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.form-container {
  max-width: 700px;
  margin: 0 auto;
}

.form-header {
  text-align: center;
  margin-bottom: 2rem;
}

.form-header h1 {
  margin-bottom: 0.5rem;
}

.form-subtitle,
.form-price {
  color: var(--color-gray-500);
  font-family: var(--font-mono);
  margin-bottom: 0.25rem;
}

.personal-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.875rem;
}

/* Order page: license-style field titles (uppercase, like card) */
.order-page .order-form .order-form-label {
  display: block;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gray-900);
  line-height: 1.3;
}

.order-page .order-form .order-form-label-optional {
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--color-gray-500);
  font-size: 0.75rem;
}

.order-page .form-row--split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .order-page .form-row--split {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }
}

.order-page .form-group--class .order-form-label {
  margin-bottom: 0.25rem;
}

.form-group input,
.form-group select {
  padding: 0.75rem;
  border: 1px solid var(--color-gray-300);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
  background-color: var(--color-white);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-black);
}

.form-group input[type="date"] {
  cursor: pointer;
}

.form-group input[type="file"] {
  padding: 0.5rem;
  cursor: pointer;
}

.form-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-gray-500);
  font-family: var(--font-mono);
}

.license-class-hint {
  display: block;
  margin-top: 0.5rem;
  max-width: 36rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--color-gray-400);
  font-family: var(--font-sans);
}

/* Don’t stretch to full row width (form-group is flex column + stretch) */
.photo-preview {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.625rem;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
}

.photo-preview img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--color-gray-300);
  display: block;
}

.photo-remove-btn {
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-sans);
  line-height: 1.2;
  color: var(--color-gray-800);
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.photo-remove-btn:hover {
  border-color: var(--color-black);
  background-color: var(--color-gray-50);
  color: var(--color-black);
}

.photo-remove-btn:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 2px;
}

.license-type-buttons {
  display: flex;
  gap: 0.5rem;
}

.license-type-btn {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid var(--color-gray-300);
  background-color: var(--color-white);
  color: var(--color-black);
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
}

.license-type-btn:hover {
  border-color: var(--color-gray-400);
}

.license-type-btn.active {
  background-color: var(--color-black);
  color: var(--color-white);
  border-color: var(--color-black);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-direction: column;
}

@media (min-width: 640px) {
  .form-actions {
    flex-direction: row;
  }
}

.form-actions .btn-secondary {
  flex: 0 0 auto;
  order: 1;
}

@media (min-width: 640px) {
  .form-actions .btn-secondary {
    order: 0;
  }
}

.form-actions .btn-primary {
  flex: 1;
  order: 0;
}

@media (min-width: 640px) {
  .form-actions .btn-primary {
    order: 1;
  }
}

.error-message {
  padding: 0.75rem;
  background-color: #fee;
  border: 1px solid #fcc;
  border-radius: 4px;
  color: #c00;
  font-size: 0.875rem;
}

.success-message {
  padding: 0.75rem;
  background-color: #efe;
  border: 1px solid #cfc;
  border-radius: 4px;
  color: #060;
  font-size: 0.875rem;
}

/* Dashboard (matches home: header, mono accents, minimal UI) */
.dashboard-page {
  padding-top: calc(5.5rem + env(safe-area-inset-top, 0px));
  padding-bottom: 2rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.dashboard-page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-gray-200);
}

.dashboard-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  color: var(--color-black);
}

.dashboard-lead {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gray-500);
}

.dashboard-content {
  margin-top: 0;
}

/* Loader */
.dashboard-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  min-height: 42vh;
  min-height: 42dvh;
  padding: 3rem 1rem;
}

.dashboard-loader-spinner {
  width: 36px;
  height: 36px;
  border: 2px solid var(--color-gray-200);
  border-top-color: var(--color-black);
  border-radius: 50%;
  animation: dashboard-spin 0.75s linear infinite;
}

@keyframes dashboard-spin {
  to {
    transform: rotate(360deg);
  }
}

.dashboard-loader-text {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gray-600);
}

.dashboard-summary {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gray-500);
}

.dashboard-summary-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-black);
  letter-spacing: 0.04em;
}

.dashboard-license-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-card,
.dashboard-license-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: 8px;
  padding: 1.5rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dashboard-card--empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.dashboard-card-heading {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

.dashboard-card-body {
  margin: 0 0 1.5rem;
  color: var(--color-gray-600);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.dashboard-card-cta {
  width: 100%;
  max-width: 280px;
}

.dashboard-license-card {
  padding: 1.35rem 1.25rem;
}

.dashboard-license-card__info {
  min-width: 0;
}

.dashboard-license-number {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: 0.02em;
}

.dashboard-license-meta {
  margin: 0;
  font-size: 0.8125rem;
}

.dashboard-license-row {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--color-gray-100);
}

.dashboard-license-row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.dashboard-license-row dt {
  margin: 0;
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.6875rem;
}

.dashboard-license-row dd {
  margin: 0;
  color: var(--color-gray-800);
  font-weight: 500;
}

.dashboard-error {
  text-align: left;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--color-gray-200);
  background: var(--color-gray-50);
}

.dashboard-error-title {
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--color-black);
}

.dashboard-error-detail {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-gray-600);
}

@media (max-width: 480px) {
  .dashboard-license-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

/* Custom Number Modal (order page) */
.custom-number-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) calc(1rem + env(safe-area-inset-right, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px)) calc(1rem + env(safe-area-inset-left, 0px));
  animation: fadeIn 0.2s ease;
}

.custom-number-modal.hidden {
  display: none;
}

.custom-number-modal-content {
  background: var(--color-white);
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.15);
}

.custom-number-modal-content.custom-number-modal-large {
  max-width: min(1120px, 96vw);
  width: 100%;
  /* Fixed shell height so the dialog doesn’t jump when search returns few cards */
  height: min(720px, 85vh);
  max-height: 85vh;
  height: min(720px, 85dvh);
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.custom-number-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.custom-number-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-gray-600);
  padding: 0.25rem;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.custom-number-modal-close:hover {
  color: var(--color-black);
}

.custom-number-modal-search {
  margin-bottom: 1rem;
}

.custom-number-filters {
  margin-bottom: 1rem;
}

/*
 * Modal filter chips: parent is a flex column with overflow:hidden.
 * overflow-x: auto on .filters-wrapper makes min-height:auto resolve to 0 in flex layout,
 * which collapses the row — only a sliver of the tabs stays visible.
 */
.custom-number-modal-large .filters-wrapper.custom-number-filters {
  flex-shrink: 0;
  min-height: min-content;
  overflow-y: visible;
  margin-bottom: 1rem;
}

.custom-number-modal-large .custom-number-modal-header,
.custom-number-modal-large .custom-number-modal-search {
  flex-shrink: 0;
}

.license-grid-modal {
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 0;
  /* Fill space between filters and Load More; min-height:0 enables flex scrolling */
  flex: 1 1 auto;
  min-height: 0;
  /* Denser grid than main license-select page */
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)) !important;
  gap: 0.65rem 0.75rem;
  align-content: start;
}

@media (min-width: 640px) {
  .license-grid-modal {
    grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)) !important;
  }
}

@media (min-width: 900px) {
  .license-grid-modal {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)) !important;
  }
}

/* Smaller option tiles inside the modal only */
.license-grid-modal .license-card {
  padding: 0.7rem 0.55rem;
}

.license-grid-modal .license-card-number {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.license-grid-modal .license-card-price {
  font-size: 0.8125rem;
  margin-bottom: 0.15rem;
}

.license-grid-modal .license-card-category {
  font-size: 0.6rem;
  padding: 0.12rem 0.35rem;
  margin-top: 0.3rem;
}

.license-grid-modal .license-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.custom-number-modal-large .load-more-container {
  flex-shrink: 0;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.custom-number-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.custom-number-modal-subtitle {
  font-size: 0.875rem;
  color: var(--color-gray-600);
  margin-bottom: 1rem;
}

.custom-number-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-gray-300);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.custom-number-input:focus {
  outline: none;
  border-color: var(--color-black);
}

.custom-number-error {
  font-size: 0.875rem;
  color: var(--color-destructive, #dc2626);
  margin-bottom: 1rem;
}

.custom-number-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.btn-choose-custom {
  margin-top: 0.75rem;
  width: 100%;
}

/* Pay button: desktop = under Choose custom number; mobile = in form */
.form-actions-desktop {
  display: none;
  margin-top: 1rem;
  width: 100%;
}

.form-actions-desktop #submit-btn-desktop {
  width: 100%;
  padding: 0.75rem 1.5rem;
  min-height: 45px;
  height: auto;
}

.form-actions-mobile {
  display: block;
}

@media (min-width: 1024px) {
  .form-actions-desktop {
    display: block;
  }

  .form-actions-mobile {
    display: none;
  }
}

.order-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.order-page-header .btn-back {
  position: absolute;
  left: calc(16px + env(safe-area-inset-left, 0px));
  bottom: 0;
  margin-bottom: -1px;
}

.order-page-header .order-header-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.order-page-title {
  font-size: 1.75rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.5rem;
}

.order-hero-card {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.order-hero-card .hero-card-container {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
}

/* Dummy Stripe Payment Popup */
.payment-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) calc(1rem + env(safe-area-inset-right, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px)) calc(1rem + env(safe-area-inset-left, 0px));
  animation: fadeIn 0.2s ease;
}

.payment-popup-overlay.hidden {
  display: none;
}

/* Leave page confirmation (order back link) */
.nav-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) calc(1rem + env(safe-area-inset-right, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px)) calc(1rem + env(safe-area-inset-left, 0px));
  animation: fadeIn 0.2s ease;
}

.nav-confirm-overlay.hidden {
  display: none;
}

.nav-confirm-dialog {
  background: var(--color-white);
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.15);
  padding: 1.5rem;
}

.nav-confirm-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--color-black);
}

.nav-confirm-text {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-gray-600);
  margin: 0 0 1.25rem;
}

.nav-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.nav-confirm-actions .btn-secondary,
.nav-confirm-actions .btn-primary {
  min-width: 6.5rem;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.payment-popup {
  background: var(--color-white);
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.15);
  max-height: 90vh;
  overflow-y: auto;
}

.payment-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-gray-200);
}

.payment-popup-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #635bff;
  letter-spacing: -0.02em;
}

.payment-popup-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-gray-500);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
}

.payment-popup-close:hover {
  color: var(--color-gray-600);
  background: var(--color-gray-100);
}

.payment-popup-body {
  padding: 1.5rem;
}

.payment-popup-title {
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.payment-popup-subtitle {
  font-size: 0.875rem;
  color: var(--color-gray-600);
  margin-bottom: 1.25rem;
}

.payment-popup-form {
  margin-bottom: 1.25rem;
}

.payment-popup-field {
  margin-bottom: 1rem;
}

.payment-popup-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-gray-700);
  margin-bottom: 0.375rem;
}

.payment-popup-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-gray-300);
  border-radius: 6px;
  font-size: 0.9375rem;
  background: var(--color-gray-50);
}

.payment-popup-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.payment-popup-amount {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--color-gray-50);
  border-radius: 8px;
  margin-bottom: 1em;
  font-weight: 600;
}

.payment-popup-pay {
  width: 100%;
  margin-bottom: 0.75rem;
}

.payment-popup-demo {
  font-size: 0.75rem;
  color: var(--color-gray-500);
  text-align: center;
}
