/* ── Modal Overlay ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 250ms cubic-bezier(0.4,0,0.2,1);
}
.modal-overlay.open {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  height: min(92vh, 600px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 250ms cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 24px 64px rgba(0,0,0,0.22);
}
.modal-overlay.open .modal-card {
  transform: scale(1);
}

/* ── Modal Header ── */
.modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--navy);
  padding: 14px 20px;
  flex-shrink: 0;
}
.modal-header-logo {
  height: 40px;
  width: auto;
  flex-shrink: 0;
  background: #fff;
  border-radius: 8px;
  padding: 4px 6px;
}
.modal-header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.modal-header-text strong {
  color: var(--blue);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.modal-header-text span {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}
.modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 150ms, background 150ms;
  line-height: 1;
  flex-shrink: 0;
}
.modal-close:hover { color: #fff; background: rgba(255,255,255,0.12); }

/* ── Step Bar ── */
.modal-steps {
  display: flex;
  align-items: flex-start;
  padding: 14px 20px 0;
  gap: 0;
  flex-shrink: 0;
}
.modal-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
}
.modal-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 2px;
  background: #e2e8f0;
  transition: background 300ms;
  z-index: 0;
}
.modal-step.completed:not(:last-child)::after {
  background: var(--blue);
}
.step-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: #f8fafc;
  transition: border-color 200ms, background 200ms;
  position: relative;
  z-index: 1;
}
.modal-step.active .step-icon-wrap {
  border-color: var(--blue);
  background: var(--blue);
}
.modal-step.completed .step-icon-wrap {
  border-color: var(--blue);
  background: var(--blue);
}
.step-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: #94a3b8;
  text-align: center;
  transition: color 200ms;
  white-space: nowrap;
}
.modal-step.active .step-label,
.modal-step.completed .step-label {
  color: var(--navy);
  font-weight: 600;
}

/* ── Modal Body ── */
.modal-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.step-panel {
  position: absolute;
  inset: 0;
  padding: 16px 24px 4px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateX(100%);
  transition: transform 350ms cubic-bezier(0.45,0,0.55,1);
  opacity: 0;
  pointer-events: none;
}
.step-panel.active {
  transform: translateX(0);
  opacity: 1;
  pointer-events: all;
}
.step-panel.exit-left {
  transform: translateX(-100%);
  opacity: 0;
}
.step-panel.exit-right {
  transform: translateX(100%);
  opacity: 0;
}
.step-panel.enter-right {
  transform: translateX(100%);
  opacity: 0;
}
.step-panel.enter-left {
  transform: translateX(-100%);
  opacity: 0;
}

.panel-icon {
  font-size: 1.8rem;
  text-align: center;
  line-height: 1;
}
.panel-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  margin: 0;
}
.panel-sub {
  font-size: 0.82rem;
  color: #64748b;
  text-align: center;
  margin: 0;
}

/* ── Form Fields ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
}
.form-group input,
.form-group textarea,
.form-group select {
  padding: 9px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--navy);
  background: #f8fafc;
  transition: border-color 200ms, background 200ms;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--blue);
  background: #fff;
}
.form-group.error input,
.form-group.error textarea {
  border-color: #ef4444;
}
.field-error {
  font-size: 0.74rem;
  color: #ef4444;
  min-height: 0;
  line-height: 1.3;
}

/* ── Service Cards ── */
.service-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.service-card-option {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 200ms, background 200ms, transform 150ms;
  position: relative;
  user-select: none;
}
.service-card-option:hover {
  border-color: var(--blue);
  background: rgba(107,189,227,0.06);
  transform: translateY(-2px);
}
.service-card-option.selected {
  border-color: var(--blue);
  background: rgba(107,189,227,0.12);
}
.service-card-option .card-emoji { font-size: 1.5rem; margin-bottom: 6px; }
.service-card-option .card-title { font-size: 0.85rem; font-weight: 700; color: var(--navy); }
.service-card-option .card-desc { font-size: 0.75rem; color: #64748b; margin-top: 4px; }
.best-value-tag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #f59e0b;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

/* ── Schedule ── */
.time-options {
  display: flex;
  gap: 10px;
}
.time-option {
  flex: 1;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  transition: border-color 200ms, background 200ms, color 200ms;
  user-select: none;
}
.time-option:hover { border-color: var(--blue); color: var(--navy); }
.time-option.selected { border-color: var(--blue); background: rgba(107,189,227,0.12); color: var(--navy); }
.time-option .time-icon { font-size: 1.3rem; margin-bottom: 4px; }

/* ── Modal Footer ── */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px 16px;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
  gap: 12px;
}
.btn-modal-back {
  background: none;
  border: 1.5px solid #cbd5e1;
  color: #64748b;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 200ms, color 200ms;
}
.btn-modal-back:hover { border-color: var(--navy); color: var(--navy); }
.btn-modal-back.hidden { visibility: hidden; }
.btn-modal-next {
  background: var(--cta, #2563eb);
  color: #fff;
  border: none;
  padding: 11px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 200ms, transform 150ms;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-modal-next:hover { background: #1d4ed8; transform: translateY(-1px); }
.btn-modal-next:active { transform: translateY(0); }

/* ── Confirmation ── */
.confirmation-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 28px;
  gap: 16px;
}
.check-circle {
  width: 72px;
  height: 72px;
}
.check-circle circle {
  fill: none;
  stroke: #22c55e;
  stroke-width: 3;
}
.check-circle path {
  fill: none;
  stroke: #22c55e;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  transition: stroke-dashoffset 600ms cubic-bezier(0.4,0,0.2,1) 300ms;
}
.check-circle.animate path { stroke-dashoffset: 0; }
.confirmation-panel h2 { font-size: 1.4rem; color: var(--navy); margin: 0; }
.confirmation-panel p { color: #64748b; margin: 0; font-size: 0.95rem; }
.confirmation-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--navy);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  margin-top: 8px;
  transition: background 200ms;
}
.confirmation-phone:hover { background: #2563eb; }

/* ── Mobile ── */
@media (max-width: 640px) {
  .modal-card { border-radius: 12px; max-height: 95vh; }
  .form-row { grid-template-columns: 1fr; }
  .service-cards { grid-template-columns: 1fr; }
  .modal-steps { padding: 16px 12px 0; }
  .step-label { font-size: 0.65rem; }
  .step-icon-wrap { width: 34px; height: 34px; font-size: 0.95rem; }
}
