/* ═══════════════════════════════════════════════════════════════════════════
   Printin3D — 3D Scanning Service
   Aesthetic: Precision Engineering — clean technical surfaces, teal scanning
   pulse, geometric depth. Like a calibration interface for a scanner.
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Prosto+One&family=Catamaran:wght@300;400;500;600;700&display=swap');

/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --teal:        #179ca3;
  --teal-dark:   #0f7a80;
  --teal-light:  #e6f7f8;
  --teal-glow:   rgba(23, 156, 163, 0.18);
  --teal-glow-strong: rgba(23, 156, 163, 0.35);

  --bg:          #f4f7f8;
  --surface:     #ffffff;
  --border:      #dde6e8;
  --border-focus:#179ca3;
  --text:        #1a2a2c;
  --text-muted:  #607d82;
  --text-light:  #9ab4b8;

  --success:     #16a34a;
  --error:       #dc2626;
  --warning:     #d97706;

  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   20px;
  --shadow-sm:   0 1px 4px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.04);
  --shadow:      0 4px 20px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.12), 0 4px 16px rgba(0,0,0,.06);

  --transition:  cubic-bezier(.4,0,.2,1);
  --font-head:   'Prosto One', serif;
  --font-body:   'Catamaran', sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  /* subtle geometric grid background */
  background-image:
    linear-gradient(rgba(23,156,163,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23,156,163,.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
}

.site-logo-fallback {
  font-family: var(--font-head);
  font-size: 1.2rem;
  color: var(--teal);
  letter-spacing: .02em;
}

.header-badge {
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Progress Bar ───────────────────────────────────────────────────────── */
.progress-wrap {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px 20px;
}

.progress-inner {
  max-width: 800px;
  margin: 0 auto;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.progress-step-label {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-light);
  transition: color .3s var(--transition);
}
.progress-step-label.active { color: var(--teal); }
.progress-step-label.done   { color: var(--teal-dark); }

.progress-track {
  height: 6px;
  background: var(--teal-light);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-dark));
  border-radius: 99px;
  transition: width .5s var(--transition);
  position: relative;
}

/* scanning pulse on the fill edge */
.progress-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 24px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5));
  animation: scan-pulse 1.5s ease-in-out infinite;
}
@keyframes scan-pulse {
  0%,100% { opacity: 0; } 50% { opacity: 1; }
}

.progress-text {
  margin-top: 8px;
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Main Container ─────────────────────────────────────────────────────── */
.form-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ── Step Card ──────────────────────────────────────────────────────────── */
.step-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 40px;
  animation: step-in .35s var(--transition) both;
}

@keyframes step-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-out {
  animation: step-out .25s var(--transition) both !important;
}
@keyframes step-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-12px); }
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--teal-light);
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 16px;
  font-family: var(--font-body);
}

.step-title {
  font-family: var(--font-head);
  font-size: 1.75rem;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: -.01em;
}

.step-subtitle {
  font-size: .95rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 32px;
  line-height: 1.5;
}

/* ── Form Fields ────────────────────────────────────────────────────────── */
.field-group {
  display: grid;
  gap: 20px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 540px) { .field-row { grid-template-columns: 1fr; } }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field input,
.field select,
.field textarea {
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  width: 100%;
  transition: border-color .2s, box-shadow .2s, background .2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23607d82' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--teal-glow);
}

.field input.error,
.field select.error,
.field textarea.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}

.field-error {
  font-size: .78rem;
  color: var(--error);
  font-weight: 500;
  display: none;
}
.field-error.visible { display: block; }

.field textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* Phone field with intl-tel-input overrides */
.iti {
  width: 100%;
}
.iti__flag-container { top: 0; bottom: 0; }
.iti--separate-dial-code .iti__selected-flag {
  background: transparent;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-right: 1.5px solid var(--border);
}
.field input.iti__tel-input {
  padding-left: 90px;
}

/* ── Option Cards (selectable tiles) ───────────────────────────────────── */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.option-grid.two-col {
  grid-template-columns: 1fr 1fr;
}

.option-grid.single-col {
  grid-template-columns: 1fr;
}

@media (max-width: 480px) {
  .option-grid, .option-grid.two-col { grid-template-columns: 1fr; }
}

.option-card {
  position: relative;
  cursor: pointer;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface);
  padding: 20px;
  transition: border-color .2s, box-shadow .2s, transform .15s, background .2s;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card:hover {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
  transform: translateY(-2px);
}

.option-card.selected {
  border-color: var(--teal);
  background: var(--teal-light);
  box-shadow: 0 0 0 3px var(--teal-glow);
}

.option-card.selected .option-check {
  opacity: 1;
  transform: scale(1);
}

.option-check {
  position: absolute;
  top: 12px; right: 12px;
  width: 22px; height: 22px;
  background: var(--teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .2s, transform .2s;
}

.option-check::after {
  content: '';
  width: 6px; height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.option-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.option-title {
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--text);
  line-height: 1.2;
}

.option-desc {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.4;
  font-weight: 400;
}

.option-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--teal-dark);
  background: rgba(23,156,163,.12);
  padding: 3px 10px;
  border-radius: 99px;
  width: fit-content;
}

/* ── Info Box (shown after selection) ──────────────────────────────────── */
.info-box {
  background: var(--teal-light);
  border: 1.5px solid rgba(23,156,163,.25);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 16px;
  font-size: .9rem;
  color: var(--text);
  line-height: 1.6;
  display: none;
  animation: step-in .3s var(--transition);
}
.info-box.visible { display: block; }

.info-box strong { color: var(--teal-dark); }

.info-box a {
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--teal-light);
  transition: border-color .2s;
}
.info-box a:hover { border-color: var(--teal); }

.warning-box {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: .88rem;
  color: #78350f;
  line-height: 1.55;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.warning-box .warn-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ── Address Block ──────────────────────────────────────────────────────── */
.address-block {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: .9rem;
  font-weight: 500;
  white-space: pre-line;
  line-height: 1.7;
  color: var(--text);
  font-family: var(--font-body);
}

/* ── Navigation Buttons ─────────────────────────────────────────────────── */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  gap: 12px;
}

.btn {
  font-family: var(--font-body);
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .03em;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 28px;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s, opacity .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  line-height: 1;
}

.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--teal);
  color: white;
  box-shadow: 0 4px 14px rgba(23,156,163,.35);
}
.btn-primary:hover {
  background: var(--teal-dark);
  box-shadow: 0 6px 20px rgba(23,156,163,.45);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg);
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-ghost.hidden { visibility: hidden; pointer-events: none; }

.btn-lg {
  font-size: 1rem;
  padding: 16px 36px;
  border-radius: var(--radius);
}

.btn-icon {
  font-size: 1rem;
}

/* spinner inside button */
.btn .spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.btn.loading .spinner { display: block; }
.btn.loading .btn-label { opacity: .6; }

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

/* ── Order Summary ──────────────────────────────────────────────────────── */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.summary-table td {
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.summary-table td:first-child { color: var(--text-muted); }
.summary-table td:last-child  { text-align: right; font-weight: 600; color: var(--text); }

.summary-table tr:last-child td { border-bottom: none; }

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0 0;
  border-top: 2px solid var(--text);
  margin-top: 4px;
}

.summary-total .label {
  font-family: var(--font-head);
  font-size: 1.05rem;
}

.summary-total .amount {
  font-family: var(--font-head);
  font-size: 1.6rem;
  color: var(--teal);
}

.vat-note {
  font-size: .78rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
}

/* ── Payment section ────────────────────────────────────────────────────── */
.payment-section {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.payment-section p {
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.5;
}

.stripe-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  color: var(--text-light);
  margin-top: 12px;
  justify-content: center;
}
.stripe-badge svg { opacity: .5; }

/* ── Success / Thank You Screen ─────────────────────────────────────────── */
.success-screen {
  text-align: center;
  padding: 24px 0;
}

.success-icon {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--teal-light), rgba(23,156,163,.15));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 2.2rem;
  animation: pop-in .4s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(.4); }
  to   { opacity: 1; transform: scale(1); }
}

.success-screen h2 {
  font-family: var(--font-head);
  font-size: 2rem;
  margin-bottom: 12px;
  color: var(--text);
}

.success-screen p {
  color: var(--text-muted);
  font-size: .97rem;
  max-width: 420px;
  margin: 0 auto 8px;
  line-height: 1.6;
}

.success-next-steps {
  text-align: left;
  background: var(--teal-light);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0;
}

.success-next-steps h4 {
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--teal-dark);
  margin-bottom: 14px;
}

.next-step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  font-size: .9rem;
}
.next-step-item:last-child { margin-bottom: 0; }

.next-step-num {
  width: 24px; height: 24px;
  background: var(--teal);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── Divider ────────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* ── Section Label ──────────────────────────────────────────────────────── */
.section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Cookie Banner ──────────────────────────────────────────────────────── */
.cookie-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--text);
  color: #e5e7eb;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: .85rem;
  z-index: 999;
  transform: translateY(100%);
  transition: transform .4s var(--transition);
}
.cookie-bar.visible { transform: translateY(0); }
.cookie-bar a { color: var(--teal); text-decoration: none; }

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal-light); }

/* ── Utilities ──────────────────────────────────────────────────────────── */
.hidden  { display: none !important; }
.mt-4    { margin-top: 16px; }
.mt-6    { margin-top: 24px; }
.text-sm { font-size: .85rem; }
.text-muted { color: var(--text-muted); }
.bold    { font-weight: 700; }
.teal    { color: var(--teal); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .step-card { padding: 24px 20px; }
  .step-title { font-size: 1.4rem; }
  .nav-buttons { flex-direction: column-reverse; }
  .nav-buttons .btn { width: 100%; justify-content: center; }
  .btn-ghost.hidden { display: none !important; }
  .option-grid { grid-template-columns: 1fr; }
}

/* ── Admin overrides (loaded separately but scoped here too) ───────────── */
.admin-body {
  background: var(--bg);
  background-image: none;
}

/* ── WhatsApp FAB ───────────────────────────────────────────────────────── */
.wa-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--teal);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  padding: 10px 18px 10px 10px;
  box-shadow: 0 4px 16px rgba(23,156,163,.4), 0 2px 6px rgba(0,0,0,.15);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  transition: transform .2s, box-shadow .2s;
  white-space: nowrap;
}
.wa-fab svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.wa-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(23,156,163,.5), 0 3px 8px rgba(0,0,0,.18);
}
.wa-fab-label {
  font-size: .85rem;
}
@media (max-width: 480px) {
  .wa-fab {
    bottom: 16px;
    right: 16px;
    padding: 10px;
    border-radius: 50%;
  }
  .wa-fab-label { display: none; }
}

/* ── Upsell checkbox (step 6) ───────────────────────────────────────────── */
.upsell-check {
  margin: 0 0 20px;
  background: linear-gradient(135deg, #e6f7f8 0%, #f0fdf4 100%);
  border: 1.5px solid rgba(23,156,163,.25);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.upsell-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: .95rem;
  color: var(--text);
  line-height: 1.4;
}
.upsell-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--teal);
  cursor: pointer;
}

/* ── Printed copies step (3p) ───────────────────────────────────────────── */
.print-copies-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, #e6f7f8 0%, #f0fdf4 100%);
  border: 1.5px solid rgba(23,156,163,.25);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.print-copies-info { display: flex; flex-direction: column; gap: 4px; }
.print-copies-label {
  font-family: var(--font-head);
  font-size: 1.05rem;
  color: var(--text);
}
.print-copies-price {
  font-size: .9rem;
  color: var(--teal-dark);
  font-weight: 600;
}
.qty-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  flex-shrink: 0;
}
.qty-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.qty-btn:hover { background: var(--teal); color: white; }
.qty-value {
  min-width: 44px;
  text-align: center;
  font-family: var(--font-head);
  font-size: 1.3rem;
  color: var(--text);
}
.print-copies-subtotal {
  margin-top: 14px;
  text-align: center;
  font-size: .95rem;
  color: var(--text-muted);
}
.print-copies-subtotal strong { color: var(--teal); }
