/* Embed booking - matches templates/appointment-booking.html */
:root {
  --bg: #0f0f0f;
  --surface: #1c1c1c;
  --surface2: #242424;
  --surface3: #2c2c2c;
  --border: #2e2e2e;
  --border2: #3c3c3c;
  --primary: #fa1917;
  --primary-dark: #c91210;
  --primary-glow: rgba(250,25,23,0.2);
  --primary-dim: rgba(250,25,23,0.09);
  --text: #f0f0f0;
  --text-muted: #7a7a7a;
  --text-light: #404040;
  --accent: #22c55e;
  --accent-dim: rgba(34,197,94,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 50% at 0% 0%, rgba(160,8,8,0.28) 0%, transparent 60%),
    radial-gradient(ellipse 45% 40% at 100% 100%, rgba(130,6,6,0.16) 0%, transparent 60%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.booking-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 900px;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 50% at 0% 0%, rgba(160,8,8,0.22) 0%, transparent 60%),
    radial-gradient(ellipse 50% 45% at 100% 100%, rgba(130,6,6,0.14) 0%, transparent 60%);
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
}

/* Progress bar */
.progress-bar { padding: 20px 32px 16px; border-bottom: 1px solid var(--border); background: rgba(0,0,0,0.3); }
.steps-track { display: flex; align-items: flex-start; position: relative; max-width: 900px; margin: 0 auto; }
.step-item { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.step-connector { position: absolute; top: 17px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 1px; background: var(--border2); z-index: 0; transition: background 0.4s; }
.step-connector.done { background: var(--primary); }
.step-dot { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border2); background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--text-muted); position: relative; z-index: 1; transition: all 0.3s; }
.step-item.active .step-dot { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-glow); }
.step-item.done .step-dot { border-color: var(--border2); background: var(--surface3); color: var(--text-muted); }
.step-label { font-size: 10.5px; font-weight: 500; color: var(--text-light); margin-top: 7px; text-align: center; letter-spacing: 0.3px; transition: color 0.3s; white-space: nowrap; }
.step-item.active .step-label { color: var(--primary); font-weight: 700; }
.step-item.done .step-label { color: var(--text-muted); }

/* Body */
.booking-body { padding: 28px 32px 0; max-width: 900px; width: 100%; margin: 0 auto; }
.step-panel { display: none; animation: fadeSlide 0.25s ease; }
.step-panel.active { display: block; }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.panel-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 20px; text-align: center; letter-spacing: -0.3px; }

.booking-loading { text-align: center; padding: 40px; color: var(--text-muted); }

/* Service grid */
.service-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.service-card { border: 1px solid var(--border); border-radius: 10px; padding: 18px 16px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: all 0.2s; background: var(--surface); text-align: center; flex-direction: column; justify-content: center; }
.service-card:hover { border-color: var(--primary); background: var(--primary-dim); }
.service-card.selected { border-color: var(--primary); background: var(--primary-dim); box-shadow: inset 0 0 0 1px var(--primary); }
.service-icon { width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--primary); margin: 0 auto; }
.service-icon i { font-size: 24px; }
.service-info { text-align: center; }
.service-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.service-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }

/* Tech grid */
.tech-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tech-card { border: 1px solid var(--border); border-radius: 10px; padding: 18px 12px; cursor: pointer; text-align: center; transition: all 0.2s; background: var(--surface); }
.tech-card:hover { border-color: var(--primary); background: var(--primary-dim); }
.tech-card.selected { border-color: var(--primary); background: var(--primary-dim); box-shadow: inset 0 0 0 1px var(--primary); }
.tech-card.any-tech { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 18px; border-style: dashed; }
.tech-avatar { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; color: white; border: 2px solid var(--border2); flex-shrink: 0; transition: border-color 0.2s; }
.any-tech .tech-avatar { margin: 0; }
.tech-card.selected .tech-avatar { border-color: var(--primary); }
.tech-info-col { flex: 1; }
.tech-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.tech-specialty { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.tech-badge { display: inline-block; margin-top: 7px; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: var(--accent-dim); color: var(--accent); }
.any-tech .tech-badge { margin: 0 0 0 auto; background: rgba(255,255,255,0.04); color: var(--text-muted); }

/* Calendar */
.calendar-box { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.cal-header { padding: 12px 18px; background: var(--surface2); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.cal-title { font-size: 14px; font-weight: 600; color: var(--text); }
.cal-nav { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border2); background: var(--surface3); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all 0.15s; font-size: 15px; }
.cal-nav:hover { background: var(--primary); color: white; border-color: var(--primary); }
.cal-grid { padding: 12px 14px; }
.cal-days-header { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 8px; gap: 4px; }
.cal-day-name { text-align: center; font-size: 11px; font-weight: 700; color: var(--text); padding: 6px 2px; letter-spacing: 0.3px; }
.cal-dates { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-date { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 4px 6px; font-size: 14px; font-weight: 600; color: var(--text); border-radius: 7px; cursor: default; transition: all 0.15s; gap: 4px; }
.cal-date-num { display: block; line-height: 1; }
.cal-date-bar { display: block; width: 60%; height: 3px; border-radius: 2px; background: transparent; }
.cal-date.has-slots { cursor: pointer; color: var(--text); }
.cal-date.has-slots .cal-date-bar { background: var(--accent); }
.cal-date.has-slots:hover { background: rgba(34,197,94,0.08); }
.cal-date.selected { background: var(--primary); }
.cal-date.selected .cal-date-num { color: white; font-weight: 700; }
.cal-date.selected .cal-date-bar { background: rgba(255,255,255,0.4); }
.cal-date.disabled .cal-date-num { opacity: 0.25; }
.cal-date.today:not(.selected) .cal-date-num { font-weight: 700; color: var(--primary); }
.cal-date.empty { pointer-events: none; }

.slots-section { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.slots-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; }
.slots-label span { color: var(--primary); }
.slot-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.time-slot { padding: 7px 14px; border: 1.5px solid var(--accent); border-radius: 20px; font-size: 12px; font-weight: 500; color: var(--accent); background: var(--accent-dim); cursor: pointer; transition: all 0.15s; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.time-slot:hover { background: var(--accent); color: #fff; }
.time-slot.selected { background: var(--primary); border-color: var(--primary); color: white; }
.time-slot.unavailable { opacity: 0.25; cursor: default; border-color: var(--border2); color: var(--text-muted); background: transparent; }
.time-slot.unavailable:hover { background: transparent; color: var(--text-muted); }

/* Location */
.location-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 320px)); justify-content: center; gap: 12px; margin-bottom: 14px; }
.location-card { border: 1px solid var(--border); border-radius: 10px; padding: 22px 16px; cursor: pointer; text-align: center; transition: all 0.2s; background: var(--surface); }
.location-card:hover { border-color: var(--primary); background: var(--primary-dim); }
.location-card.selected { border-color: var(--primary); background: var(--primary-dim); box-shadow: inset 0 0 0 1px var(--primary); }
.location-icon { width: 44px; height: 44px; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; color: var(--primary); }
.location-icon i { font-size: 24px; }
.location-title { font-size: 14px; font-weight: 700; color: var(--text); }
.location-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.location-detail { border: 1px solid var(--border); border-radius: 10px; padding: 16px; background: var(--surface2); animation: fadeSlide 0.2s ease; }
.location-detail label { color: var(--text-muted); }
#onsiteDetail .form-group label { color: #fff; }
.location-detail input { color: var(--text); background: var(--surface3); }
.location-detail input::placeholder { color: var(--text-muted); opacity: 0.9; }
.store-address { display: flex; align-items: flex-start; gap: 12px; }
.store-address-icon { width: 38px; height: 38px; background: var(--primary-dim); border: 1px solid var(--primary-glow); border-radius: 9px; display: flex; align-items: center; justify-content: center; color: var(--primary); flex-shrink: 0; }
.store-address-icon i { font-size: 18px; }
.addr-name { font-weight: 700; font-size: 13px; color: var(--text); }
.addr-line { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }

/* Forms */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-row.single { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 10.5px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase; }
#step5 .form-group label { color: #fff; }
#step5 input::placeholder,
#step5 textarea::placeholder { color: #a0a0a0; }
#onsiteDetail input::placeholder { color: #a0a0a0; }
input, textarea { border: 1px solid var(--border2); border-radius: 8px; padding: 10px 13px; font-size: 13.5px; font-family: inherit; color: var(--text); background: var(--surface2); outline: none; transition: border-color 0.2s, box-shadow 0.2s; width: 100%; }
input::placeholder, textarea::placeholder { color: var(--text-light); }
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
textarea { resize: vertical; min-height: 90px; }

/* Summary */
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 10px; }
.summary-item { border: 1px solid var(--border); border-radius: 9px; padding: 11px 13px; background: var(--surface); }
.summary-item.full-width { grid-column: 1 / -1; }
.sum-label { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-light); margin-bottom: 4px; }
.sum-value { font-size: 13px; font-weight: 500; color: var(--text); }

/* Confirmation */
.confirm-screen { text-align: center; padding: 32px 24px 28px; display: flex; flex-direction: column; align-items: center; }
.confirm-icon { width: 72px; height: 72px; background: rgba(34,197,94,0.14); border: 1px solid rgba(34,197,94,0.3); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; color: #22c55e; animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.confirm-icon.confirm-icon-red { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-glow); }
.confirm-icon i { font-size: 32px; }
.confirm-icon.confirm-icon-red i { font-size: 28px; }
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confirm-title { font-size: 22px; font-weight: 700; color: var(--text); }
.confirm-sub { font-size: 13.5px; color: var(--text); margin-top: 8px; max-width: 420px; line-height: 1.6; }
.confirm-email { color: var(--primary); font-weight: 600; }
.confirm-id-box { margin-top: 20px; padding: 14px 24px; background: var(--surface); border: 1px solid var(--primary-glow); border-radius: 10px; box-shadow: 0 0 12px var(--primary-glow); }
.confirm-id-label { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text); margin-bottom: 4px; }
.confirm-id-value { font-size: 18px; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--primary); letter-spacing: 0.5px; }
.confirm-info-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; width: 100%; max-width: 680px; margin-top: 24px; text-align: left; }
.confirm-card { border: 1px solid var(--border2); border-radius: 10px; padding: 14px 16px; background: var(--surface); min-width: 0; }
.confirm-card-icon { color: var(--primary); font-size: 18px; margin-bottom: 8px; }
.confirm-card-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text); margin-bottom: 6px; }
.confirm-card-value { font-size: 12.5px; font-weight: 500; color: var(--text); line-height: 1.5; }
.confirm-contact .contact-name, .confirm-location .location-name { font-weight: 700; display: block; margin-bottom: 2px; }
.confirm-reminder { display: flex; align-items: flex-start; gap: 10px; margin-top: 24px; padding: 12px 16px; background: rgba(250,25,23,0.08); border: 1px solid var(--primary-glow); border-radius: 8px; max-width: 680px; width: 100%; text-align: left; font-size: 12px; color: var(--text); line-height: 1.5; }
.confirm-reminder i { color: var(--primary); font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.confirm-phone { color: var(--primary); font-weight: 600; text-decoration: none; }
.confirm-phone:hover { text-decoration: underline; }
/* Footer */
.booking-footer { padding: 16px 32px 24px; max-width: 900px; width: 100%; margin: 0 auto; }
.btn-next { width: 100%; padding: 15px; background: var(--primary); color: white; border: none; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; transition: all 0.2s; letter-spacing: 0.2px; margin-bottom: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-next i { font-size: 14px; }
.btn-next:hover { background: var(--primary-dark); box-shadow: 0 4px 20px var(--primary-glow); }
.btn-next:active { transform: scale(0.998); }
.btn-next.success { background: #16a34a; }
.btn-next.success:hover { background: #15803d; }
.footer-meta { display: flex; align-items: center; justify-content: space-between; }
.btn-back { padding: 4px 0; background: none; border: none; color: var(--text-muted); font-size: 12.5px; font-weight: 500; cursor: pointer; font-family: inherit; transition: color 0.2s; display: flex; align-items: center; gap: 4px; }
.btn-back:hover { color: var(--text); }
.step-count { font-size: 11.5px; color: var(--text-light); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Error */
.error-msg { display: none; color: var(--primary); font-size: 12px; margin-top: 10px; padding: 9px 13px; background: var(--primary-dim); border: 1px solid var(--primary-glow); border-radius: 8px; }
.error-msg.show { display: block; }

@media (max-width: 640px) {
  .progress-bar, .booking-body, .booking-footer { padding-left: 16px; padding-right: 16px; }
  .service-grid, .location-options, .summary-grid { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .cal-day-name { font-size: 9px; padding: 4px 1px; }
  .cal-date { font-size: 13px; padding: 6px 2px 5px; }
  .confirm-info-grid { grid-template-columns: 1fr; }
  .confirm-info-col { order: 2; }
  .confirm-qr-col { order: 1; }
  .confirm-footer { justify-content: center; }
}
