/* ============================================================
   JVS HOME CLEANING — DESIGN SYSTEM v2.0
   Mobile-First | Premium | Editorial
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,500;0,9..144,700;1,9..144,400&display=swap');

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  /* Brand */
  --brand-900: #03254e;
  --brand-800: #063870;
  --brand-700: #0a4d8b;
  --brand-600: #1261a8;
  --brand-500: #1a75c4;
  --brand-400: #4d9fe0;
  --brand-100: #e8f3fc;
  --brand-50:  #f0f7ff;

  /* Accent */
  --accent:     #ff6b35;
  --accent-dk:  #e05520;
  --accent-lt:  #fff0eb;

  /* Neutrals */
  --ink-900: #0d0f12;
  --ink-700: #2c3140;
  --ink-500: #5a6072;
  --ink-400: #8891a1;
  --ink-200: #d4d9e3;
  --ink-100: #eef0f5;
  --ink-50:  #f7f8fa;
  --white:   #ffffff;

  /* Semantic */
  --success: #16a34a;
  --success-lt: #dcfce7;
  --warning: #d97706;
  --warning-lt: #fef3c7;
  --danger:  #dc2626;
  --danger-lt: #fee2e2;

  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* Border radius */
  --r-sm:  6px;
  --r-md:  12px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-full: 999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(13,15,18,.08), 0 1px 2px rgba(13,15,18,.04);
  --shadow-md:  0 4px 16px rgba(13,15,18,.10), 0 2px 6px rgba(13,15,18,.06);
  --shadow-lg:  0 16px 40px rgba(13,15,18,.12), 0 4px 12px rgba(13,15,18,.06);
  --shadow-xl:  0 32px 64px rgba(13,15,18,.14), 0 8px 24px rgba(13,15,18,.08);
  --shadow-brand: 0 4px 20px rgba(10,77,139,.25);
  --shadow-accent: 0 4px 20px rgba(255,107,53,.30);

  /* Motion */
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:   cubic-bezier(0.4, 0, 1, 1);
  --ease-both: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:  150ms;
  --dur-base:  250ms;
  --dur-slow:  400ms;
  --dur-enter: 600ms;
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-700);
  background: var(--ink-50);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}
a { color: inherit; text-decoration: none; }

/* ─── PAGE LAYOUT ────────────────────────────────────────── */
.page-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--s-4) var(--s-4) var(--s-10);
  background:
    radial-gradient(ellipse 70% 40% at 50% -10%, rgba(10,77,139,.10) 0%, transparent 70%),
    var(--ink-50);
}

/* ─── PROGRESS BAR ───────────────────────────────────────── */
.progress-bar {
  width: 100%;
  max-width: 540px;
  margin: 0 auto var(--s-6);
  padding-top: var(--s-4);
}
.progress-track {
  height: 3px;
  background: var(--ink-200);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-700), var(--brand-500));
  border-radius: var(--r-full);
  transition: width var(--dur-slow) var(--ease-out);
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--s-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-400);
}
.progress-labels .current { color: var(--brand-700); }

/* ─── CARD SHELL ─────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  overflow: hidden;
  animation: cardEnter var(--dur-enter) var(--ease-out) both;
}

.card-header {
  padding: var(--s-8) var(--s-8) 0;
}

.card-body {
  padding: var(--s-6) var(--s-8) var(--s-8);
}

/* Wide layout for 2-col pages (date, confirm, contact) */
.card.wide {
  max-width: 860px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-8);
}

@media (min-width: 680px) {
  .two-col { grid-template-columns: 1fr 1fr; }
}

/* ─── BRAND HEADER ───────────────────────────────────────── */
.brand-top {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-8);
  width: 100%;
  max-width: 540px;
}
.brand-logo {
  width: 36px;
  height: 36px;
  background: var(--brand-700);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 17px;
  flex-shrink: 0;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink-700);
  letter-spacing: -.01em;
}
.brand-name span { color: var(--brand-700); }

/* ─── STEP HEADING ───────────────────────────────────────── */
.step-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin-bottom: var(--s-2);
}
.step-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin-bottom: var(--s-2);
}
.step-sub {
  font-size: 15px;
  color: var(--ink-500);
  margin-bottom: var(--s-6);
}

/* ─── OPTION LIST ────────────────────────────────────────── */
.option-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.option-item {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border: 1.5px solid var(--ink-200);
  border-radius: var(--r-md);
  cursor: pointer;
  background: var(--white);
  transition:
    border-color var(--dur-base) var(--ease-out),
    background   var(--dur-base) var(--ease-out),
    transform    var(--dur-base) var(--ease-out),
    box-shadow   var(--dur-base) var(--ease-out);
  animation: itemSlideIn var(--dur-slow) var(--ease-out) both;
  position: relative;
  overflow: hidden;
}

.option-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10,77,139,.04), transparent);
  opacity: 0;
  transition: opacity var(--dur-base);
}

.option-item:hover {
  border-color: var(--brand-500);
  background: var(--brand-50);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.option-item:hover::before { opacity: 1; }

.option-item:active { transform: translateY(0) scale(.99); }

/* stagger children */
.option-item:nth-child(1) { animation-delay: 60ms; }
.option-item:nth-child(2) { animation-delay: 100ms; }
.option-item:nth-child(3) { animation-delay: 140ms; }
.option-item:nth-child(4) { animation-delay: 180ms; }
.option-item:nth-child(5) { animation-delay: 220ms; }
.option-item:nth-child(6) { animation-delay: 260ms; }
.option-item:nth-child(7) { animation-delay: 300ms; }
.option-item:nth-child(8) { animation-delay: 340ms; }

.option-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--brand-50);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-700);
  font-size: 18px;
  flex-shrink: 0;
  transition: background var(--dur-base), color var(--dur-base);
}
.option-item:hover .option-icon {
  background: var(--brand-700);
  color: white;
}

.option-text { flex: 1; min-width: 0; }
.option-label {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-900);
  display: block;
}
.option-desc {
  font-size: 13px;
  color: var(--ink-500);
  display: block;
  margin-top: 2px;
}

.option-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.option-price {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink-900);
}
.option-arrow {
  color: var(--ink-400);
  font-size: 14px;
  transition: transform var(--dur-base) var(--ease-out), color var(--dur-base);
}
.option-item:hover .option-arrow {
  color: var(--brand-700);
  transform: translateX(4px);
}

/* ─── BOOKING SUMMARY SIDEBAR ────────────────────────────── */
.summary-box {
  background: var(--brand-50);
  border: 1.5px solid var(--brand-100);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  position: sticky;
  top: var(--s-4);
}
.summary-title {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand-700);
  margin-bottom: var(--s-5);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.summary-rows { display: flex; flex-direction: column; gap: var(--s-3); }
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
}
.summary-row .label { color: var(--ink-500); }
.summary-row .value { font-weight: 600; color: var(--ink-900); text-align: right; }
.summary-divider {
  border: none;
  border-top: 1px solid var(--brand-100);
  margin: var(--s-3) 0;
}
.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--s-3);
}
.summary-total .label { font-weight: 700; font-size: 15px; color: var(--ink-900); }
.summary-total .value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-700);
}

/* ─── FORM ELEMENTS ──────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
}
@media (min-width: 500px) {
  .form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}
.form-field { display: flex; flex-direction: column; gap: var(--s-2); }
.form-field.span-2 { grid-column: 1 / -1; }

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
  letter-spacing: .01em;
}
.label-required::after { content: ' *'; color: var(--accent); }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 13px var(--s-4);
  border: 1.5px solid var(--ink-200);
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-900);
  background: var(--white);
  transition:
    border-color var(--dur-base),
    box-shadow var(--dur-base),
    background var(--dur-base);
  -webkit-appearance: none;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
select { cursor: pointer; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(10,77,139,.12);
  background: var(--white);
}
input::placeholder, textarea::placeholder { color: var(--ink-400); font-weight: 400; }
input.error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.10); }

.field-hint {
  font-size: 12px;
  color: var(--ink-400);
  margin-top: 2px;
}
.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 2px;
  display: none;
}
.field-error.visible { display: block; }

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 14px var(--s-6);
  border: none;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--dur-base),
    transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base);
  white-space: nowrap;
  letter-spacing: .01em;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--brand-700);
  color: white;
  box-shadow: var(--shadow-brand);
  width: 100%;
}
.btn-primary:hover:not(:disabled) {
  background: var(--brand-800);
  box-shadow: 0 6px 28px rgba(10,77,139,.35);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-accent);
  width: 100%;
}
.btn-accent:hover:not(:disabled) {
  background: var(--accent-dk);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-500);
  border: 1.5px solid var(--ink-200);
}
.btn-ghost:hover { background: var(--ink-50); border-color: var(--ink-400); }

.btn-lg { padding: 16px var(--s-8); font-size: 16px; border-radius: var(--r-lg); }
.btn-sm { padding: 9px var(--s-4); font-size: 13px; }

.btn-icon { width: 44px; height: 44px; padding: 0; border-radius: var(--r-md); }

/* ─── CHIPS / TAGS ───────────────────────────────────────── */
.chip-group { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip {
  padding: 7px var(--s-4);
  border-radius: var(--r-full);
  border: 1.5px solid var(--ink-200);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-500);
  cursor: pointer;
  transition: all var(--dur-base);
  background: var(--white);
  white-space: nowrap;
}
.chip:hover { border-color: var(--brand-500); color: var(--brand-700); background: var(--brand-50); }
.chip.active {
  border-color: var(--brand-700);
  background: var(--brand-700);
  color: white;
  box-shadow: 0 2px 8px rgba(10,77,139,.25);
}

/* ─── TIME SLOT GRID ─────────────────────────────────────── */
.time-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-2);
}
@media (min-width: 360px) {
  .time-grid { grid-template-columns: repeat(4, 1fr); }
}
.time-slot {
  padding: 10px 6px;
  border: 1.5px solid var(--ink-200);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-600, var(--ink-700));
  cursor: pointer;
  text-align: center;
  background: var(--white);
  transition: all var(--dur-base) var(--ease-out);
}
.time-slot:hover { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-700); }
.time-slot.selected {
  border-color: var(--brand-700);
  background: var(--brand-700);
  color: white;
  box-shadow: 0 2px 8px rgba(10,77,139,.25);
}
.time-slot.am { }
.time-slot.pm { }

/* ─── EXTRAS GRID ────────────────────────────────────────── */
.extras-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}
@media (min-width: 460px) {
  .extras-grid { grid-template-columns: 1fr 1fr; }
}

.extra-card {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1.5px solid var(--ink-200);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
  background: var(--white);
  position: relative;
  user-select: none;
}
.extra-card input[type="checkbox"] { display: none; }
.extra-card:has(input:checked) {
  border-color: var(--brand-600);
  background: var(--brand-50);
}
.extra-card:hover { border-color: var(--brand-400); }

.extra-check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink-200);
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-base);
  color: transparent;
  font-size: 12px;
}
.extra-card:has(input:checked) .extra-check {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: white;
}

.extra-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--ink-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--ink-500);
  flex-shrink: 0;
  transition: all var(--dur-base);
}
.extra-card:has(input:checked) .extra-icon {
  background: var(--brand-100);
  color: var(--brand-700);
}

.extra-info { flex: 1; min-width: 0; }
.extra-name { font-size: 13px; font-weight: 600; color: var(--ink-900); display: block; }
.extra-price { font-size: 13px; font-weight: 700; color: var(--brand-700); }

/* ─── NOTICE / ALERT ─────────────────────────────────────── */
.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  animation: fadeIn var(--dur-base) var(--ease-out);
}
.notice.info  { background: var(--brand-50);   color: var(--brand-800);  border: 1px solid var(--brand-100); }
.notice.success { background: var(--success-lt); color: #14532d; border: 1px solid #bbf7d0; }
.notice.warning { background: var(--warning-lt); color: #78350f; border: 1px solid #fde68a; }
.notice.error   { background: var(--danger-lt);  color: #7f1d1d; border: 1px solid #fecaca; }
.notice i { margin-top: 1px; flex-shrink: 0; }

/* ─── COUPON FIELD ───────────────────────────────────────── */
.coupon-wrap {
  display: flex;
  gap: var(--s-2);
}
.coupon-wrap input { flex: 1; }
.coupon-wrap .btn { white-space: nowrap; }

/* ─── FLATPICKR OVERRIDE ─────────────────────────────────── */
.flatpickr-calendar {
  border-radius: var(--r-lg) !important;
  box-shadow: var(--shadow-xl) !important;
  border: none !important;
  font-family: var(--font-body) !important;
  overflow: hidden;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--brand-700) !important;
  border-color: var(--brand-700) !important;
}
.flatpickr-day:hover {
  background: var(--brand-50) !important;
  color: var(--brand-700) !important;
}
.flatpickr-months { padding: 8px; }
.flatpickr-current-month { font-family: var(--font-display) !important; }

/* ─── LOADING STATE ──────────────────────────────────────── */
.loading-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: var(--s-6);
}
.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-400);
  animation: bounce 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }

.skeleton {
  background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-50) 50%, var(--ink-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--r-sm);
}

/* ─── FOOTER ─────────────────────────────────────────────── */
.page-footer {
  margin-top: var(--s-6);
  font-size: 12px;
  color: var(--ink-400);
  text-align: center;
  letter-spacing: .02em;
}
.page-footer a { color: var(--ink-400); text-decoration: underline; }

/* ─── BACK BUTTON ────────────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-500);
  cursor: pointer;
  padding: var(--s-2) 0;
  background: none;
  border: none;
  margin-bottom: var(--s-4);
  transition: color var(--dur-base);
}
.back-btn:hover { color: var(--brand-700); }
.back-btn i { font-size: 12px; transition: transform var(--dur-base) var(--ease-out); }
.back-btn:hover i { transform: translateX(-3px); }

/* ─── KEYFRAMES ──────────────────────────────────────────── */
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(20px) scale(.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes itemSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); opacity: .4; }
  40%           { transform: scale(1); opacity: 1; }
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes checkPop {
  0%   { transform: scale(0) rotate(-10deg); }
  70%  { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE HELPERS ─────────────────────────────────── */
@media (min-width: 640px) {
  .page-wrap { padding: var(--s-8) var(--s-6) var(--s-10); }
  .card-header { padding: var(--s-10) var(--s-10) 0; }
  .card-body { padding: var(--s-6) var(--s-10) var(--s-10); }
}

/* ─── UTILITY ────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.text-center { text-align: center; }
.mt-2 { margin-top: var(--s-2); }
.mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); }
.gap-4 { gap: var(--s-4); }
.w-full { width: 100%; }
