/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy: #224375;
  --light-blue: #62A1BD;
  --pale-blue: #D7E7EB;
  --gold: #D1A56A;
  --beige: #EAE6E3;
  --white: #ffffff;
  --error: #D94040;
  --shadow: 0 4px 24px rgba(34, 67, 117, 0.1);
  --radius: 12px;
  --transition: 0.3s ease;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--beige);
  color: var(--navy);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}

/* ===== Form Container ===== */
.form-container {
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

/* ===== Progress Bar ===== */
.progress-bar {
  height: 4px;
  background: #e0e0e0;
  position: relative;
  flex-shrink: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 0 2px 2px 0;
}

/* ===== Back Button ===== */
.back-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  background: none;
  border: none;
  color: var(--navy);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background var(--transition);
  opacity: 0;
  pointer-events: none;
}

.back-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-btn:hover {
  background: var(--beige);
}

/* ===== Steps ===== */
.steps-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.step {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(60px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  overflow-y: auto;
}

.step.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
}

.step.exit-left {
  opacity: 0;
  transform: translateX(-60px);
}

.step.enter-right {
  transform: translateX(60px);
}

.step.enter-left {
  transform: translateX(-60px);
}

.step.exit-right {
  opacity: 0;
  transform: translateX(60px);
}

/* ===== Step Content ===== */
.step-content {
  width: 100%;
  padding: 48px 32px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.step-header {
  margin-bottom: 28px;
}

.step-icon {
  margin-bottom: 12px;
}

.step-header h2 {
  font-size: 1.5rem;
  color: var(--navy);
}

/* ===== Welcome Step ===== */
.welcome-step .logo {
  margin-bottom: 24px;
}

.welcome-step h1 {
  font-size: 1.75rem;
  margin-bottom: 28px;
  color: var(--navy);
  line-height: 1.3;
}

.value-props {
  width: 100%;
  margin-bottom: 32px;
}

.value-prop {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  text-align: left;
  font-size: 0.95rem;
  color: #4a5568;
}

.value-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--pale-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tagline {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--light-blue);
  font-style: italic;
  letter-spacing: 0.5px;
}

/* ===== Buttons ===== */
.btn {
  border: none;
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(98, 161, 189, 0.4);
}

.btn-primary {
  background: var(--gold);
  color: var(--white);
  padding: 14px 48px;
  width: 100%;
  max-width: 320px;
  margin-top: 8px;
}

.btn-primary:hover {
  background: #c4944e;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(209, 165, 106, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-lg {
  padding: 16px 48px;
  font-size: 1.1rem;
}

/* ===== Input Fields ===== */
.input-group {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.field {
  text-align: left;
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  color: var(--navy);
  transition: border-color var(--transition);
  outline: none;
}

.field input::placeholder {
  color: #a0aec0;
}

.field input:focus {
  border-color: var(--gold);
}

.field input.invalid {
  border-color: var(--error);
}

.field-error {
  display: block;
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 4px;
  min-height: 1.2em;
}

.consent-text {
  margin-top: 16px;
  font-size: 0.75rem;
  color: #718096;
  line-height: 1.5;
  max-width: 320px;
}

/* ===== Visit Type Cards ===== */
.visit-type-cards {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.visit-type-card {
  background: var(--white);
  border: 2px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  font-family: 'Montserrat', sans-serif;
  display: flex;
  align-items: center;
  gap: 14px;
}

.visit-type-card:hover {
  border-color: var(--light-blue);
  background: #f7fbfc;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(98, 161, 189, 0.15);
}

.visit-type-card.selected {
  border-color: var(--gold);
  background: #faf6f0;
}

/* ===== Location Cards ===== */
.location-cards {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.location-card {
  background: var(--white);
  border: 2px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  font-family: 'Montserrat', sans-serif;
}

.location-card:hover {
  border-color: var(--light-blue);
  background: #f7fbfc;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(98, 161, 189, 0.15);
}

.location-card.selected {
  border-color: var(--gold);
  background: #faf6f0;
}

.location-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
}

.location-address {
  font-size: 0.75rem;
  color: #718096;
  white-space: nowrap;
}

/* ===== Goal Cards ===== */
.goal-cards {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.goal-card {
  background: var(--white);
  border: 2px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  font-family: 'Montserrat', sans-serif;
  display: flex;
  align-items: center;
  gap: 14px;
}

.goal-card:hover {
  border-color: var(--light-blue);
  background: #f7fbfc;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(98, 161, 189, 0.15);
}

.goal-card.selected {
  border-color: var(--gold);
  background: #faf6f0;
}

.goal-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: var(--pale-blue);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.goal-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.goal-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
}

.goal-desc {
  font-size: 0.8rem;
  color: #718096;
}

.goal-other {
  border-style: dashed;
}

/* Book a Treatment card (in goals step) */
.goal-book-treatment {
  margin-top: 24px;
}

.goal-book-treatment .goal-name {
  font-size: 0.95rem;
  font-weight: 700;
}

/* ===== Consent Text ===== */
.consent-text {
  margin-top: 16px;
  font-size: 0.75rem;
  color: #718096;
  line-height: 1.5;
  max-width: 320px;
  text-align: left;
}

.consent-text-tight {
  margin-top: 6px;
}

/* ===== Same-Day Service Question ===== */
.same-day-question {
  width: 100%;
  max-width: 320px;
  margin-top: 20px;
  margin-bottom: 8px;
}

.same-day-question h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 12px;
  text-align: center;
}

.same-day-options {
  display: flex;
  gap: 10px;
}

.same-day-btn {
  flex: 1;
  background: var(--white);
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: all var(--transition);
}

.same-day-btn:hover {
  border-color: var(--light-blue);
  background: #f7fbfc;
}

.same-day-btn.selected {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

/* ===== Treatment Cards ===== */
.treatment-cards {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.treatment-card {
  background: var(--white);
  border: 2px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  font-family: 'Montserrat', sans-serif;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.treatment-card:hover {
  border-color: var(--light-blue);
  background: #f7fbfc;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(98, 161, 189, 0.15);
}

.treatment-card.selected {
  border-color: var(--gold);
  background: #faf6f0;
}

.treatment-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
}

.treatment-meta {
  font-size: 0.85rem;
  color: #718096;
}

/* ===== Calendar ===== */
.datetime-picker {
  width: 100%;
  max-width: 360px;
}

.calendar {
  margin-bottom: 20px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-month {
  font-weight: 600;
  font-size: 1rem;
  color: var(--navy);
}

.cal-nav {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  color: var(--navy);
  transition: background var(--transition);
}

.cal-nav:hover {
  background: var(--beige);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #a0aec0;
  padding: 4px 0;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day {
  background: none;
  border: none;
  padding: 10px 4px;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  color: var(--navy);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.cal-day:hover:not(.disabled):not(.selected) {
  background: var(--beige);
}

.cal-day.selected {
  background: var(--gold);
  color: var(--white);
}

.cal-day.today:not(.selected) {
  font-weight: 700;
  color: var(--light-blue);
}

.cal-day.disabled {
  color: #cbd5e0;
  cursor: default;
}

.cal-day.empty {
  cursor: default;
}

/* ===== Time Slots ===== */
.time-slots {
  display: none;
}

.time-slots.visible {
  display: block;
}

.time-slots h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 12px;
  text-align: left;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.time-slot {
  background: var(--white);
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 4px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  color: var(--navy);
  cursor: pointer;
  transition: all var(--transition);
}

.time-slot:hover {
  border-color: var(--light-blue);
  background: #f7fbfc;
}

.time-slot.selected {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

.time-slot.unavailable {
  background: #f0f0f0;
  color: #b0b0b0;
  border-color: #e0e0e0;
  cursor: not-allowed;
  text-decoration: line-through;
  opacity: 0.6;
}

.time-slot.unavailable:hover {
  border-color: #e0e0e0;
  background: #f0f0f0;
}

/* ===== Availability Loading ===== */
.availability-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  color: #718096;
  font-size: 0.9rem;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--gold, #d4a843);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Confirmation ===== */
.confirmation-step h2 {
  font-size: 1.75rem;
  margin-bottom: 24px;
}

.checkmark-circle {
  width: 96px;
  height: 96px;
  background: var(--beige);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  animation: scaleIn 0.5s ease forwards;
}

@keyframes scaleIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.checkmark-path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: drawCheck 0.4s 0.3s ease forwards;
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.summary {
  width: 100%;
  max-width: 320px;
  background: var(--beige);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  text-align: left;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9rem;
}

.summary-item:not(:last-child) {
  border-bottom: 1px solid #ddd8d4;
}

.summary-label {
  color: #718096;
  font-weight: 500;
}

.summary-value {
  font-weight: 600;
  color: var(--navy);
  text-align: right;
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-editable {
  cursor: pointer;
  border-radius: 6px;
  transition: background var(--transition);
}

.summary-editable:hover {
  background: rgba(209, 165, 106, 0.1);
}

.edit-icon {
  color: #a0aec0;
  flex-shrink: 0;
}

.summary-editable:hover .edit-icon {
  color: var(--gold);
}

.summary-edit-input {
  width: 100%;
  max-width: 160px;
  padding: 4px 8px;
  border: 2px solid var(--gold);
  border-radius: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  text-align: right;
  outline: none;
}

.confirm-message {
  font-size: 0.95rem;
  color: #718096;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ===== Responsive ===== */
@media (max-width: 520px) {
  body {
    padding: 0;
    align-items: flex-start;
  }

  .form-container {
    border-radius: 0;
    min-height: 100dvh;
    box-shadow: none;
  }

  .step-content {
    padding: 48px 24px 24px;
  }

  .welcome-step h1 {
    font-size: 1.5rem;
  }

  .step-header h2 {
    font-size: 1.3rem;
  }

  .time-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
