@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@500;700;900&family=Heebo:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --paper: #F5F3EC;
  --paper-dark: #EAE6D9;
  --ink: #211F1B;
  --ink-soft: #6B675D;
  --accent: #0E8C88;
  --accent-soft: #DCEFEC;
  --red: #D14B3D;
  --line: #D9D3C2;
}

* { box-sizing: border-box; }

.skip-link {
  position: absolute;
  right: 10px;
  top: -45px;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 1000;
  transition: top .15s;
  text-decoration: none;
  font-size: 14px;
}
.skip-link:focus { top: 10px; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
}
.site-footer a { color: var(--ink-soft); }

body {
  margin: 0;
  font-family: 'Heebo', sans-serif;
  background: var(--paper);
  color: var(--ink);
}

.num { font-family: 'JetBrains Mono', monospace; direction: ltr; unicode-bidi: isolate; }
h1, h2, h3, .display { font-family: 'Rubik', sans-serif; }

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

/* header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.brand-text h1 { font-size: 17px; font-weight: 700; line-height: 1.2; margin: 0; }
.brand-text p { font-size: 12px; color: var(--ink-soft); margin: 2px 0 0; }
.install-btn { padding: 8px 14px; font-size: 13px; white-space: nowrap; }
.user-info { text-align: left; font-size: 14px; }
.user-name { font-weight: 500; }
.user-email { font-size: 11px; color: var(--ink-soft); }

/* steps */
.steps {
  list-style: none;
  display: flex;
  align-items: flex-start;
  margin: 0 0 32px;
  padding: 0;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 56px;
}
.step-circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--paper-dark);
  color: var(--ink-soft);
  transition: background .2s, color .2s;
}
.step.active .step-circle, .step.done .step-circle {
  background: var(--accent);
  color: #fff;
}
.step-label {
  font-size: 11px;
  text-align: center;
  color: var(--ink-soft);
}
.step.active .step-label, .step.done .step-label { color: var(--ink); }
.step-line {
  flex: 1;
  height: 2px;
  margin: 15px 4px 0;
  background: var(--line);
  transition: background .2s;
}
.step-line.done { background: var(--accent); }

/* card */
.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(33,31,27,0.06);
  padding: 28px;
}
.center-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 24px; }
.card h2 { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.muted { color: var(--ink-soft); font-size: 14px; }
.small { font-size: 12px; }
.hint { font-size: 11px; color: var(--ink-soft); margin-top: 16px; }
.error { color: var(--red); font-size: 13px; }

/* buttons */
.btn-dark, .btn-accent, .btn-pay, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Heebo', sans-serif;
  cursor: pointer;
}
.btn-dark { background: var(--ink); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-pay { background: var(--red); color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-dark:disabled, .btn-accent:disabled, .btn-pay:disabled {
  background: var(--line); color: #fff; cursor: not-allowed;
}
.full { width: 100%; margin-top: 20px; }
.btn-link {
  background: none; border: none; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Heebo', sans-serif;
}
.btn-link.enabled { color: var(--accent); }
.btn-link:disabled { cursor: default; }

.google-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}

.spin {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* form fields */
.field { margin-bottom: 16px; text-align: right; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field-input {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}
.field-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-input input, .field-input select {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: 'Heebo', sans-serif;
  background: transparent;
  min-width: 0;
}
.field-input select { cursor: pointer; }
.field-icon { color: var(--ink-soft); flex-shrink: 0; }

.consent-group { display: flex; flex-direction: column; margin-bottom: 16px; text-align: right; }
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}
.checkbox-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--accent);
  cursor: pointer;
}

.google-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 20px;
}
.google-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.google-chip .chip-name { font-size: 14px; font-weight: 500; }
.google-chip .chip-email { font-size: 11px; color: var(--ink-soft); }
.google-badge {
  margin-right: auto;
  font-size: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* OTP */
.otp-row { display: flex; gap: 10px; justify-content: center; direction: ltr; margin-bottom: 8px; }
.otp-box {
  width: 46px; height: 54px;
  text-align: center;
  font-size: 20px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
}
.otp-box:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.otp-box.error-box { border-color: var(--red); }

/* upload */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 28px 16px;
  background: var(--paper);
  cursor: pointer;
  text-align: center;
  margin-bottom: 20px;
  transition: background .15s, border-color .15s;
}
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone-icon { font-size: 22px; color: var(--accent); }
.dropzone-title { font-size: 14px; font-weight: 500; }

.help-details {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 20px;
  background: var(--paper);
}
.help-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  list-style: none;
}
.help-details summary::-webkit-details-marker { display: none; }
.help-details summary::before { content: "▸ "; }
.help-details[open] summary::before { content: "▾ "; }
.help-details-body { margin-top: 10px; font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.help-details-body p { margin: 0 0 8px; }
.help-details-body p:last-child { margin-bottom: 0; }
.help-details-body b { color: var(--ink); }

.file-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
.file-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.file-card-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-remove { background: none; border: none; cursor: pointer; color: var(--red); font-size: 15px; line-height: 1; flex-shrink: 0; }
.file-pages { font-size: 12px; color: var(--ink-soft); margin-bottom: 10px; }
.file-pages b { color: var(--ink); }
.file-loading { font-size: 13px; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }

.pill-group { margin-bottom: 10px; }
.pill-group-label { font-size: 11px; color: var(--ink-soft); margin-bottom: 5px; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-family: 'Heebo', sans-serif;
}
.pill.selected { background: var(--accent); color: #fff; }
.pill.selected.dark { background: var(--ink); }
.pill.grow { flex: 1; text-align: center; }

.qty-row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.qty-controls { display: flex; align-items: center; gap: 8px; }
.qty-label { font-size: 11px; color: var(--ink-soft); }
.qty-btn {
  width: 24px; height: 24px;
  border-radius: 6px;
  border: none;
  background: var(--paper);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.qty-value { font-size: 14px; font-weight: 700; width: 18px; text-align: center; }
.file-price { font-size: 14px; font-weight: 700; color: var(--accent); }

/* products upsell */
.products-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
}
.products-title { font-family: 'Rubik', sans-serif; font-size: 17px; font-weight: 700; margin: 0 0 16px; }
.products-row + .products-row { margin-top: 22px; }
.products-row-title { font-size: 13px; font-weight: 700; margin: 0 0 10px; color: var(--ink-soft); }
.product-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.product-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  flex: 0 0 172px;
  width: 172px;
  scroll-snap-align: start;
  box-shadow: 0 2px 10px rgba(33, 31, 27, .05);
  transition: transform .15s ease, box-shadow .15s ease;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(33, 31, 27, .12);
}
.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #f2f2f2;
}
.product-image-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  background: var(--accent-soft);
}
.product-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  min-height: 34px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.product-colors { display: flex; flex-wrap: wrap; gap: 4px; }
.color-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 600;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-family: 'Heebo', sans-serif;
}
.color-pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.color-swatch {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, .2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
}
.product-price { font-size: 15px; font-weight: 700; color: var(--accent); }
.product-add {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .1s ease, background .15s ease;
}
.product-add:hover { background: #0a7370; transform: scale(1.08); }
.product-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px;
}
.product-qty .qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.product-qty .qty-value { font-size: 13px; }

/* delivery */
.delivery-options { display: flex; gap: 12px; margin-bottom: 20px; }
.delivery-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  padding: 18px 8px;
  border: 2px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-family: 'Heebo', sans-serif;
}
.delivery-option .icon { font-size: 20px; }
.delivery-option span:last-child { font-size: 13px; font-weight: 500; }
.delivery-option.selected { border-color: var(--accent); background: var(--accent-soft); }

/* payment */
.fake-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.fake-card-number { font-size: 15px; letter-spacing: 3px; margin: 6px 0; }

/* success */
.success-icon { font-size: 40px; color: var(--accent); margin-bottom: 8px; }

/* nav row */
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
}
.back-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  font-family: 'Heebo', sans-serif;
  padding: 8px;
}

/* receipt */
.receipt-bar {
  margin-top: 20px;
  border-radius: 16px;
  padding: 20px;
  background: var(--ink);
  color: var(--paper);
}
.receipt-title {
  font-family: 'Rubik', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  margin-bottom: 10px;
}
.receipt-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #C9C6BC;
  margin-bottom: 4px;
}
.receipt-line span:first-child { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-total {
  padding-top: 10px;
  margin-top: 6px;
  border-top: 1px dashed #55524A;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.receipt-total span:first-child { font-size: 14px; font-weight: 500; color: var(--paper); }
.receipt-total span:last-child { font-size: 18px; font-weight: 700; }

@media (max-width: 480px) {
  .card { padding: 20px; }
  .step-label { display: none; }
}
