:root {
  color-scheme: light;
  --bg: #eef2f7;
  --card: rgba(255, 255, 255, 0.92);
  --ink: #0f172a;
  --muted: #64748b;
  --line: rgba(30, 58, 95, 0.1);
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --danger: #dc2626;
  --navy: #1e3a5f;
  --navy-dark: #0f1b2d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.04), transparent 40%),
    radial-gradient(circle at bottom right, rgba(30, 58, 95, 0.06), transparent 50%),
    linear-gradient(180deg, #f8fafc, #eef2f7);
  min-height: 100vh;
}

.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
  margin-bottom: 16px;
}

.hero-text,
.muted {
  color: var(--muted);
}

.receipt-frame,
.panel,
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.06);
}

.receipt-frame {
  position: relative;
  padding: 18px;
}

.receipt-image {
  width: 100%;
  border-radius: 18px;
  display: block;
  transition: filter 240ms ease;
}

.receipt-image.blurred {
  filter: blur(12px) saturate(0.7);
}

.receipt-badge {
  position: absolute;
  right: 32px;
  bottom: 32px;
  background: var(--navy-dark);
  color: white;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  backdrop-filter: blur(4px);
}

.panel {
  margin-top: 24px;
  padding: 24px;
}

.panel-copy {
  max-width: 560px;
}

.status-box {
  padding: 12px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 18px;
  color: var(--navy);
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-box.error {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.2);
  background: #fef2f2;
}

.status-box.success {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.2);
  background: var(--accent-soft);
}

.step {
  display: none;
}

.step.active {
  display: block;
}

.login-card {
  max-width: 430px;
}

.login-mark {
  display: none;
}

.modal-shell {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 10;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: min(100%, 480px);
  padding: 28px 24px;
  background: linear-gradient(145deg, #ffffff 0%, #e3eef9 40%, #d4e4f5 100%);
  border: 1px solid rgba(30, 58, 95, 0.08);
  border-radius: 30px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.15);
  overflow: hidden;
}

.modal-card::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08), transparent 70%);
  pointer-events: none;
}

.modal-card::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 58, 95, 0.06), transparent 70%);
  pointer-events: none;
}

.modal-header {
  margin-bottom: 16px;
}

.step-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  padding: 10px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.step-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.modal-card .step.active {
  display: block;
}

.modal-card .login-card {
  padding: 0;
  box-shadow: none;
  border: 0;
  background: transparent;
}

.modal-card h2 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  color: var(--navy);
}

.modal-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

label {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

input {
  width: 100%;
  margin-top: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 14px;
  font: inherit;
  background: white;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.primary-btn {
  border: none;
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  cursor: pointer;
  transition: opacity 200ms ease, transform 150ms ease, box-shadow 200ms ease;
}

.primary-btn:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.primary-btn:active:not(:disabled) {
  transform: scale(0.97);
}

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

/* Camera step */
.hidden-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}

.camera-shutter {
  position: fixed;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
  z-index: 100;
}

.camera-shutter.flash {
  opacity: 0.9;
}

.capture-progress {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 28px 0 20px;
}

.capture-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--line);
  border: 2px solid var(--accent);
  transition: all 300ms ease;
}

.capture-dot.done {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.capture-dot.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.08);
    transform: scale(1.1);
  }
}

.capture-hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero-copy h1 {
    font-size: clamp(1.6rem, 5vw, 2.4rem);
  }

  .shell {
    width: min(calc(100% - 24px), 1100px);
    padding: 20px 0 32px;
  }

  .receipt-frame {
    padding: 12px;
  }

  .receipt-badge {
    right: 22px;
    bottom: 22px;
    font-size: 0.75rem;
    padding: 7px 12px;
  }

  .panel {
    padding: 18px;
  }

  .modal-shell {
    padding: 12px;
  }

  .modal-card {
    padding: 20px 16px;
    border-radius: 24px;
  }

  .status-box {
    font-size: 0.8rem;
    padding: 10px 14px;
  }

  .primary-btn {
    width: 100%;
    padding: 14px 18px;
    text-align: center;
  }

    input {
    padding: 13px 14px;
  }
}

@media (max-width: 480px) {
  .shell {
    width: calc(100% - 16px);
    padding: 12px 0 24px;
  }

  .hero {
    gap: 14px;
  }

  .hero-copy h1 {
    font-size: clamp(1.4rem, 6vw, 1.8rem);
    margin-bottom: 10px;
  }

  .eyebrow {
    font-size: 0.75rem;
  }

  .receipt-frame {
    padding: 10px;
    border-radius: 20px;
  }

  .receipt-image {
    border-radius: 14px;
  }

  .modal-card {
    padding: 16px 14px;
    border-radius: 20px;
  }

  .modal-shell {
    padding: 8px;
  }

  .status-box {
    font-size: 0.75rem;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .primary-btn {
    padding: 13px 16px;
    font-size: 0.9rem;
  }

}
