:root {
  --brand-dark: #0f172a;
  --brand: #7c3aed;
  --brand-hover: #6d28d9;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --success: #10b981;
  --danger: #ef4444;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #94a3b8;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 12px rgb(0 0 0 / 0.08);
  --shadow-lg: 0 20px 40px rgb(0 0 0 / 0.12);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--text);
  background: var(--surface-alt);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 20px; }

/* ===== Navbar ===== */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: rgb(255 255 255 / 0.9);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.nav-brand { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--brand-dark); }
.nav-brand span { color: var(--brand); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-soft); font-weight: 500; }
.nav-cart {
  background: var(--brand-dark);
  color: white !important;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-cart:hover { background: var(--brand); text-decoration: none; }
.cart-badge {
  background: var(--accent);
  color: white;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #4c1d95 100%);
  color: white;
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(245, 158, 11, 0.25), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(124, 58, 237, 0.4), transparent 40%);
  pointer-events: none;
}
.hero-content { position: relative; text-align: center; max-width: 780px; margin: 0 auto; }
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
}
.hero h1 span { color: var(--accent); }
.hero p { font-size: 18px; color: rgb(255 255 255 / 0.85); margin: 0 0 32px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); text-decoration: none; }
.btn-secondary { background: white; color: var(--brand-dark); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-alt); text-decoration: none; }
.btn-brand { background: var(--brand); color: white; }
.btn-brand:hover { background: var(--brand-hover); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-alt); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Sections ===== */
.section { padding: 64px 0; }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 {
  font-size: clamp(26px, 3.5vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.section-title p { color: var(--text-soft); font-size: 17px; margin: 0; }

/* ===== Packs (with decoy pricing) ===== */
.packs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: stretch;
}
.pack {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 28px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.pack:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.pack-featured {
  border: 2px solid var(--brand);
  box-shadow: var(--shadow-lg);
  transform: scale(1.05);
  z-index: 2;
  background: linear-gradient(180deg, #faf5ff 0%, var(--surface) 100%);
}
.pack-featured:hover { transform: scale(1.05) translateY(-4px); }
.pack-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: white;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}
.pack-icon { font-size: 40px; margin-bottom: 8px; }
.pack h3 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.pack-target { color: var(--text-muted); font-size: 14px; margin: 0 0 20px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.pack-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 20px; }
.pack-price .amount { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; color: var(--brand-dark); }
.pack-price .currency { font-size: 24px; font-weight: 700; color: var(--brand-dark); }
.pack-price .period { font-size: 14px; color: var(--text-muted); margin-left: 6px; }
.pack-featured .pack-price .amount { color: var(--brand); }
.pack-description { color: var(--text-soft); font-size: 15px; margin: 0 0 20px; }
.pack-features { list-style: none; padding: 0; margin: 0 0 28px; flex-grow: 1; }
.pack-features li {
  padding: 8px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  color: var(--text-soft);
  border-bottom: 1px solid var(--border);
}
.pack-features li:last-child { border-bottom: none; }
.pack-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
}
.pack-cta { margin-top: auto; }
.pack-savings {
  background: rgb(16 185 129 / 0.1);
  color: #059669;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

/* ===== Catalogue ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  justify-content: center;
}
.filter-chip {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-soft);
}
.filter-chip:hover { border-color: var(--brand); color: var(--brand); }
.filter-chip.active { background: var(--brand-dark); color: white; border-color: var(--brand-dark); }

.items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.item {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}
.item:hover { box-shadow: var(--shadow-md); }
.item-photo {
  aspect-ratio: 4 / 3;
  background: var(--surface-alt);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--text-muted);
}
.item-body { padding: 18px; display: flex; flex-direction: column; flex-grow: 1; }
.item-cat { font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 700; letter-spacing: 0.05em; }
.item h4 { font-size: 16px; font-weight: 700; margin: 4px 0 8px; }
.item-desc { font-size: 13px; color: var(--text-soft); flex-grow: 1; margin: 0 0 12px; }
.item-price-row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.item-price { font-size: 20px; font-weight: 800; color: var(--brand-dark); }
.item-price small { font-size: 12px; font-weight: 500; color: var(--text-muted); }

/* ===== Cart ===== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 20px;
}
.card h3 { margin: 0 0 16px; font-size: 18px; font-weight: 700; }

.summary { position: sticky; top: 80px; }

.cart-line {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-line:last-child { border-bottom: none; }
.cart-line-photo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--surface-alt);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text-muted);
}
.cart-line-info { flex-grow: 1; min-width: 0; }
.cart-line-name { font-weight: 600; font-size: 14px; margin: 0; }
.cart-line-price { color: var(--text-muted); font-size: 13px; }
.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-weight: 700;
  color: var(--text-soft);
}
.qty-btn:hover { background: var(--surface-alt); }
.qty-value { font-weight: 600; min-width: 20px; text-align: center; }
.remove-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px 8px; font-size: 18px; }
.remove-btn:hover { color: var(--danger); }

.total-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.total-row.big { font-size: 20px; font-weight: 800; border-top: 2px solid var(--border); padding-top: 12px; margin-top: 8px; }
.total-row .label { color: var(--text-soft); }
.caution-note { background: #fef3c7; border-radius: 8px; padding: 12px; font-size: 13px; color: #92400e; margin-top: 12px; }

/* ===== Options (toggles) ===== */
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 10px;
}
.option:hover { border-color: var(--brand); }
.option.checked { border-color: var(--brand); background: #faf5ff; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option-radio {
  width: 20px; height: 20px;
  border-radius: 999px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.option.checked .option-radio { border-color: var(--brand); }
.option.checked .option-radio::after {
  content: '';
  width: 10px; height: 10px;
  border-radius: 999px;
  background: var(--brand);
}
.option-content { flex-grow: 1; }
.option-title { font-weight: 600; font-size: 15px; }
.option-desc { font-size: 13px; color: var(--text-muted); }
.option-price { font-weight: 700; color: var(--brand-dark); }

/* ===== Form ===== */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--text); }
.field input, .field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(124 58 237 / 0.15);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

/* ===== Calendar (datepicker) ===== */
.calendar {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  user-select: none;
}
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cal-header button {
  background: var(--surface-alt);
  border: none;
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-soft);
}
.cal-header button:hover { background: var(--border); }
.cal-month { font-weight: 700; font-size: 16px; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 700; padding: 6px 0; }
.cal-day {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.1s;
}
.cal-day:hover:not(.disabled):not(.empty) { background: var(--surface-alt); }
.cal-day.disabled { color: var(--text-muted); opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }
.cal-day.past { color: var(--text-muted); opacity: 0.3; cursor: not-allowed; }
.cal-day.selected { background: var(--brand); color: white; font-weight: 700; }
.cal-day.today:not(.selected) { border: 2px solid var(--brand); }
.cal-day.empty { cursor: default; }
.cal-legend { display: flex; gap: 16px; justify-content: center; margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.cal-legend span::before {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: middle;
}
.cal-legend .free::before { background: var(--surface-alt); border: 1px solid var(--border); }
.cal-legend .taken::before { background: var(--text-muted); }
.cal-legend .chosen::before { background: var(--brand); }

/* ===== Signature ===== */
.contract-preview {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  max-height: 500px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}
.contract-preview h3 { color: var(--brand-dark); font-size: 16px; margin-top: 20px; margin-bottom: 8px; }
.contract-preview table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.contract-preview th, .contract-preview td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
.contract-preview th { background: var(--surface); font-weight: 700; }

.signature-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  position: relative;
  margin-top: 12px;
}
.signature-zone canvas { display: block; width: 100%; height: 200px; border-radius: var(--radius); cursor: crosshair; touch-action: none; }
.signature-hint { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: var(--text-muted); pointer-events: none; font-size: 14px; }
.signature-hint.hidden { display: none; }
.signature-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

/* ===== Footer ===== */
.footer {
  background: var(--brand-dark);
  color: rgb(255 255 255 / 0.7);
  padding: 40px 0;
  margin-top: 60px;
  font-size: 14px;
}
.footer a { color: rgb(255 255 255 / 0.9); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; align-items: center; }

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.loader {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgb(255 255 255 / 0.3);
  border-top-color: white;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center-block { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

.stepper { display: flex; gap: 8px; justify-content: center; margin: 24px 0 32px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 14px; font-weight: 600; }
.step-num { width: 24px; height: 24px; border-radius: 999px; background: var(--border); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.step.active .step-num { background: var(--brand); color: white; }
.step.active { color: var(--text); }
.step.done .step-num { background: var(--success); color: white; }
.step-sep { color: var(--text-muted); }
