/* ============================================================
   Appointment Element — appointment.css
   Matches Michelin Car Service booking UI
   ============================================================ */

:root {
  --appt-accent:  #1B3C87;
  --appt-hl:      #F5C500;
  --appt-gray:    #f4f5f7;
  --appt-border:  #d8dce4;
  --appt-text:    #1a1a2e;
  --appt-muted:   #6b7280;
  --appt-white:   #ffffff;
  --appt-radius:  4px;
  --appt-shadow:  0 2px 8px rgba(0,0,0,.08);
}

/* ── Wrapper ──────────────────────────────────────────────── */
.appt-wrap {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  color: var(--appt-text);
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ── Title ──────────────────────────────────────────────────*/
.appt-title {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  color: var(--appt-accent);
  margin: 0 0 24px;
}

/* ── Progress bar ───────────────────────────────────────────*/
.appt-progress {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 32px;
}

.appt-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.appt-step__bar {
  width: 100%;
  height: 4px;
  background: var(--appt-border);
  position: relative;
  margin-bottom: -10px;
}

.appt-step__fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--appt-hl);
  transition: width .4s ease;
}

.appt-step.is-active   .appt-step__fill,
.appt-step.is-complete .appt-step__fill { width: 100%; }

.appt-step__dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--appt-border);
  color: var(--appt-muted);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: background .3s, color .3s;
  margin-top: 4px;
}

.appt-step.is-active .appt-step__dot,
.appt-step.is-complete .appt-step__dot {
  background: var(--appt-hl);
  color: #fff;
}

.appt-step__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--appt-muted);
  text-align: center;
  margin-top: 4px;
  letter-spacing: .03em;
  transition: color .3s;
}

.appt-step.is-active .appt-step__label,
.appt-step.is-complete .appt-step__label {
  color: var(--appt-text);
  font-weight: 700;
}

/* ── Layout ─────────────────────────────────────────────────*/
.appt-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 840px) {
  .appt-layout { grid-template-columns: 1fr; }
}

/* ── Panels ─────────────────────────────────────────────────*/
.appt-panel {
  display: none;
  background: var(--appt-white);
  border: 1px solid var(--appt-border);
  border-radius: var(--appt-radius);
  padding: 28px 32px 32px;
  box-shadow: var(--appt-shadow);
}

.appt-panel.is-active { display: block; }

.appt-panel__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--appt-border);
}

/* ── Services grid ──────────────────────────────────────────*/
.appt-services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
}

@media (max-width: 600px) {
  .appt-services-grid { grid-template-columns: 1fr; }
}

.appt-services-col__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--appt-muted);
  letter-spacing: .06em;
  margin: 0 0 12px;
}

/* ── Checkboxes ─────────────────────────────────────────────*/
.appt-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--appt-border);
  border-radius: var(--appt-radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  user-select: none;
}

.appt-checkbox:hover { border-color: var(--appt-accent); }

.appt-checkbox input[type="checkbox"] { display: none; }

.appt-checkbox__box {
  width: 18px;
  height: 18px;
  border: 2px solid var(--appt-border);
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, background .2s;
  position: relative;
}

.appt-checkbox__box::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) scale(0);
  transition: transform .15s;
  margin-top: -2px;
}

.appt-checkbox input:checked ~ .appt-checkbox__box {
  background: var(--appt-accent);
  border-color: var(--appt-accent);
}

.appt-checkbox input:checked ~ .appt-checkbox__box::after {
  transform: rotate(45deg) scale(1);
}

.appt-checkbox__text { font-weight: 600; font-size: 13px; }

/* ── Notes ──────────────────────────────────────────────────*/
.appt-note-row { margin-top: 20px; }

.appt-notes {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--appt-border);
  border-radius: var(--appt-radius);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  box-sizing: border-box;
}

/* ── Dealer panel ───────────────────────────────────────────*/
.appt-dealer-search {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.appt-dealer-search .appt-input { flex: 1; }

.appt-dealer-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 480px;
}

@media (max-width: 680px) {
  .appt-dealer-layout { grid-template-columns: 1fr; }
}

.appt-map-wrap {
  position: relative;
  border-radius: var(--appt-radius);
  overflow: hidden;
  border: 1px solid var(--appt-border);
}

#appt-map {
  width: 100%;
  height: 480px;
}

.appt-map-placeholder {
  position: absolute;
  inset: 0;
  background: #e8ecf0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--appt-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Dealer list */
.appt-dealer-list {
  overflow-y: auto;
  max-height: 480px;
  border: 1px solid var(--appt-border);
  border-radius: var(--appt-radius);
}

.appt-dealer-item {
  display: block;
  padding: 14px 16px;
  border-bottom: 1px solid var(--appt-border);
  cursor: pointer;
  transition: background .15s;
}

.appt-dealer-item:last-child { border-bottom: none; }
.appt-dealer-item:hover { background: #f0f4fb; }

.appt-dealer-item input[type="radio"] { display: none; }

.appt-dealer-item__inner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.appt-dealer-item__radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--appt-border);
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  transition: border-color .2s;
}

.appt-dealer-item__radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--appt-accent);
  transform: scale(0);
  transition: transform .15s;
}

.appt-dealer-item input:checked ~ .appt-dealer-item__inner .appt-dealer-item__radio {
  border-color: var(--appt-accent);
}

.appt-dealer-item input:checked ~ .appt-dealer-item__inner .appt-dealer-item__radio::after {
  transform: scale(1);
}

.appt-dealer-item.is-selected {
  background: #eef2fb;
  border-left: 3px solid var(--appt-accent);
}

.appt-dealer-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

.appt-dealer-item__info strong {
  font-weight: 700;
  font-size: 13px;
  color: var(--appt-accent);
  line-height: 1.4;
}

.appt-dealer-item__hours {
  font-weight: 600;
  color: #2d7c3f;
}

/* ── Schedule ────────────────────────────────────────────── */
.appt-schedule {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.appt-schedule__arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid var(--appt-border);
  border-radius: var(--appt-radius);
  background: var(--appt-white);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 52px;
  transition: background .2s;
}

.appt-schedule__arrow:hover { background: var(--appt-gray); }

.appt-schedule__grid-wrap { flex: 1; overflow: hidden; }

.appt-schedule__grid {
  display: grid;
  /* columns set by JS */
  gap: 0;
}

.appt-day-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 4px;
}

.appt-day-col__header {
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--appt-border);
  margin-bottom: 4px;
}

.appt-day-col__header .day-name {
  font-weight: 700;
  font-size: 13px;
}

.appt-day-col__header .day-date {
  font-size: 11px;
  color: var(--appt-muted);
}

.appt-time-btn {
  display: block;
  width: 100%;
  padding: 9px 6px;
  text-align: center;
  border: 1px solid var(--appt-border);
  border-radius: var(--appt-radius);
  background: var(--appt-white);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.appt-time-btn:hover {
  border-color: var(--appt-accent);
  color: var(--appt-accent);
}

.appt-time-btn.is-selected {
  background: var(--appt-accent);
  border-color: var(--appt-accent);
  color: #fff;
}

.appt-more-times {
  text-align: center;
  margin-top: 16px;
  color: var(--appt-accent);
  cursor: pointer;
  text-decoration: underline;
  font-size: 13px;
}

/* ── Personal info form ──────────────────────────────────── */
.appt-field { margin-bottom: 20px; }

.appt-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 520px) {
  .appt-field-row { grid-template-columns: 1fr; }
}

.appt-field__label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}

.appt-req { color: #c0392b; }

.appt-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--appt-border);
  border-radius: var(--appt-radius);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}

.appt-input:focus {
  border-color: var(--appt-accent);
  box-shadow: 0 0 0 3px rgba(27,60,135,.12);
}

.appt-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 13px;
}

.appt-radio input { accent-color: var(--appt-accent); }

/* Fake reCAPTCHA */
.appt-recaptcha-placeholder {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border: 1px solid var(--appt-border);
  border-radius: var(--appt-radius);
  font-size: 14px;
  background: #f9f9f9;
}

.appt-recaptcha-placeholder__check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--appt-border);
  border-radius: 3px;
  display: inline-block;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.appt-sidebar {
  background: var(--appt-white);
  border: 1px solid var(--appt-border);
  border-radius: var(--appt-radius);
  padding: 20px 20px 24px;
  box-shadow: var(--appt-shadow);
  position: sticky;
  top: 24px;
}

.appt-sidebar__title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .07em;
  margin: 0 0 16px;
  color: var(--appt-text);
}

.appt-summary-section {
  border-bottom: 1px solid var(--appt-border);
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.appt-summary-section__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.appt-summary-section__head span {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.appt-summary-toggle {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--appt-accent);
  padding: 0;
  line-height: 1;
}

.appt-summary-section__body {
  padding-top: 10px;
  font-size: 13px;
  line-height: 1.6;
}

.appt-summary__empty { color: var(--appt-muted); font-style: italic; margin: 0; }

.appt-summary__service {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 12px;
}

.appt-summary__service svg { flex-shrink: 0; margin-top: 2px; }

.appt-summary__datetime { margin: 0; font-weight: 600; }

/* ── Buttons ─────────────────────────────────────────────── */
.appt-sidebar__nav { margin-top: 20px; }
.appt-sidebar__back { margin-top: 10px; text-align: center; }

.appt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--appt-radius);
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .1s;
}

.appt-btn:active { transform: scale(.98); }

.appt-btn--primary,
.appt-btn--next,
.appt-btn--submit {
  background: var(--appt-accent);
  color: #fff;
  width: 100%;
}

.appt-btn--primary:hover,
.appt-btn--next:hover,
.appt-btn--submit:hover {
  background: #14317a;
}

.appt-link,
.appt-btn--back {
  background: none;
  border: none;
  color: var(--appt-accent);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  padding: 0;
  text-decoration: underline;
}

/* ── Messages ────────────────────────────────────────────── */
.appt-msg { font-size: 12px; margin: 8px 0 0; }
.appt-msg--error { color: #c0392b; }
.appt-msg--success { color: #2d7c3f; font-weight: 600; }

/* ── Success screen ──────────────────────────────────────── */
.appt-success {
  text-align: center;
  padding: 60px 20px;
}

.appt-success__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--appt-accent);
  color: #fff;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.appt-success h3 { font-size: 22px; color: var(--appt-accent); margin: 0 0 10px; }
.appt-success p  { color: var(--appt-muted); font-size: 14px; }

/* ── Branch map iframes ──────────────────────────────────── */
.appt-branch-map {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 480px;
}

.appt-branch-map.is-active {
  display: block;
}

.appt-branch-map iframe {
  width: 100%;
  height: 480px;
  border: 0;
  display: block;
}

/* Ensure map wrap has height when iframe is inside */
.appt-map-wrap {
  min-height: 480px;
}
