/* HDL Appointment Booking — Public / Customer UI
   High-end, theme-adaptive. Inherits fonts & colours from the active theme. */

.hdl-ab-app {
  font-family: var(--hdl-font-family, inherit);
  font-size: var(--hdl-font-size, 16px);
  color: var(--hdl-text-color, inherit);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  max-width: 720px;
  margin: 0 auto;
}

/* ── Booking form shell ─────────────────────────────── */
.hdl-booking-form {
  background: var(--hdl-surface, #fff);
  border: 1px solid var(--hdl-border, rgba(0,0,0,0.08));
  border-radius: calc(var(--hdl-radius, 10px) + 4px);
  box-shadow: var(--hdl-shadow-lg, 0 12px 40px rgba(0,0,0,0.10));
  overflow: hidden;
}

.hdl-booking-header {
  padding: 28px 32px 20px;
  background: linear-gradient(135deg, var(--hdl-primary, #1B4F72) 0%, var(--hdl-accent, #2874A6) 100%);
  color: #fff;
}

.hdl-booking-header h2 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.hdl-booking-header p {
  margin: 0;
  opacity: 0.9;
  font-size: 0.95rem;
}

.hdl-booking-body {
  padding: 28px 32px 32px;
}

/* ── Steps indicator ────────────────────────────────── */
.hdl-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

.hdl-step {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--hdl-border, rgba(0,0,0,0.1));
  transition: background 0.3s ease;
}

.hdl-step.active,
.hdl-step.done {
  background: linear-gradient(90deg, var(--hdl-primary, #1B4F72), var(--hdl-accent, #2874A6));
}

/* ── Form controls ──────────────────────────────────── */
.hdl-field {
  margin-bottom: 20px;
}

.hdl-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hdl-muted, #6b7280);
}

.hdl-field input[type="text"],
.hdl-field input[type="email"],
.hdl-field input[type="tel"],
.hdl-field input[type="date"],
.hdl-field select,
.hdl-field textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--hdl-border, rgba(0,0,0,0.12));
  border-radius: var(--hdl-radius-sm, 6px);
  background: var(--hdl-surface, #fff);
  font-size: 1rem;
  font-family: inherit;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.hdl-field input:focus,
.hdl-field select:focus,
.hdl-field textarea:focus {
  outline: none;
  border-color: var(--hdl-primary, #1B4F72);
  box-shadow: 0 0 0 4px rgba(27, 79, 114, 0.12);
}

/* ── Service cards ──────────────────────────────────── */
.hdl-service-grid {
  display: grid;
  gap: 12px;
}

.hdl-service-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1.5px solid var(--hdl-border, rgba(0,0,0,0.1));
  border-radius: var(--hdl-radius, 10px);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--hdl-surface, #fff);
}

.hdl-service-card:hover {
  border-color: var(--hdl-primary, #1B4F72);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.hdl-service-card.selected {
  border-color: var(--hdl-primary, #1B4F72);
  background: color-mix(in srgb, var(--hdl-primary, #1B4F72) 6%, white);
  box-shadow: 0 0 0 3px rgba(27, 79, 114, 0.12);
}

.hdl-service-swatch {
  width: 12px;
  height: 48px;
  border-radius: 4px;
  flex-shrink: 0;
}

.hdl-service-info {
  flex: 1;
  min-width: 0;
}

.hdl-service-info strong {
  display: block;
  font-size: 1rem;
  font-weight: 650;
  margin-bottom: 2px;
}

.hdl-service-info span {
  font-size: 0.85rem;
  color: var(--hdl-muted, #6b7280);
}

.hdl-service-meta {
  text-align: right;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hdl-primary, #1B4F72);
  white-space: nowrap;
}

/* ── Staff pills ────────────────────────────────────── */
.hdl-staff-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hdl-staff-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1.5px solid var(--hdl-border, rgba(0,0,0,0.1));
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  background: var(--hdl-surface, #fff);
}

.hdl-staff-pill:hover {
  border-color: var(--hdl-primary, #1B4F72);
}

.hdl-staff-pill.selected {
  border-color: var(--hdl-primary, #1B4F72);
  background: var(--hdl-primary, #1B4F72);
  color: #fff;
}

.hdl-staff-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Time slots ─────────────────────────────────────── */
.hdl-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.hdl-slot {
  padding: 12px 8px;
  text-align: center;
  border: 1.5px solid var(--hdl-border, rgba(0,0,0,0.1));
  border-radius: var(--hdl-radius-sm, 6px);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s ease;
  background: var(--hdl-surface, #fff);
}

.hdl-slot:hover {
  border-color: var(--hdl-primary, #1B4F72);
  color: var(--hdl-primary, #1B4F72);
}

.hdl-slot.selected {
  background: var(--hdl-primary, #1B4F72);
  border-color: var(--hdl-primary, #1B4F72);
  color: #fff;
}

.hdl-slots-empty {
  padding: 24px;
  text-align: center;
  color: var(--hdl-muted, #6b7280);
  font-size: 0.95rem;
  background: var(--hdl-surface-2, #f8f9fb);
  border-radius: var(--hdl-radius, 10px);
}

/* ── Buttons ────────────────────────────────────────── */
.hdl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--hdl-radius-sm, 6px);
  font-size: 1rem;
  font-weight: 650;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1.2;
}

.hdl-btn-primary {
  background: linear-gradient(135deg, var(--hdl-primary, #1B4F72), var(--hdl-accent, #2874A6));
  color: #fff;
  box-shadow: 0 4px 16px rgba(27, 79, 114, 0.3);
  width: 100%;
}

.hdl-btn-primary:hover {
  filter: brightness(1.08);
  color: #fff;
  box-shadow: 0 6px 20px rgba(27, 79, 114, 0.4);
}

.hdl-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.hdl-btn-secondary {
  background: transparent;
  color: var(--hdl-primary, #1B4F72);
  border: 1.5px solid var(--hdl-border, rgba(0,0,0,0.12));
}

.hdl-nav-row {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.hdl-nav-row .hdl-btn-secondary {
  flex: 0 0 auto;
}

.hdl-nav-row .hdl-btn-primary {
  flex: 1;
}

/* ── Success state ──────────────────────────────────── */
.hdl-booking-success {
  text-align: center;
  padding: 48px 32px;
}

.hdl-booking-success .hdl-check {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0e9f6e, #34d399);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
}

.hdl-booking-success h3 {
  margin: 0 0 8px;
  font-size: 1.4rem;
  color: var(--hdl-primary, #1B4F72);
}

.hdl-booking-success p {
  color: var(--hdl-muted, #6b7280);
  margin: 0 0 8px;
}

/* ── Customer portal ────────────────────────────────── */
.hdl-portal {
  max-width: 800px;
  margin: 0 auto;
}

.hdl-portal-header {
  margin-bottom: 28px;
}

.hdl-portal-header h2 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--hdl-primary, #1B4F72);
}

.hdl-appt-card {
  display: flex;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--hdl-border, rgba(0,0,0,0.08));
  border-radius: var(--hdl-radius, 10px);
  margin-bottom: 12px;
  background: var(--hdl-surface, #fff);
  box-shadow: var(--hdl-shadow, 0 4px 24px rgba(0,0,0,0.04));
  transition: box-shadow 0.2s ease;
}

.hdl-appt-card:hover {
  box-shadow: var(--hdl-shadow-lg, 0 8px 32px rgba(0,0,0,0.08));
}

.hdl-appt-date {
  flex-shrink: 0;
  width: 64px;
  text-align: center;
  padding: 8px;
  border-radius: var(--hdl-radius-sm, 6px);
  background: var(--hdl-surface-2, #f8f9fb);
}

.hdl-appt-date .day {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--hdl-primary, #1B4F72);
}

.hdl-appt-date .month {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hdl-muted, #6b7280);
}

.hdl-appt-body {
  flex: 1;
  min-width: 0;
}

.hdl-appt-body strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 2px;
}

.hdl-appt-body .meta {
  font-size: 0.9rem;
  color: var(--hdl-muted, #6b7280);
}

.hdl-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hdl-badge-success { background: #d1fae5; color: #065f46; }
.hdl-badge-warning { background: #fef3c7; color: #92400e; }
.hdl-badge-info    { background: #dbeafe; color: #1e40af; }
.hdl-badge-muted   { background: #f3f4f6; color: #4b5563; }
.hdl-badge-danger  { background: #fee2e2; color: #991b1b; }

.hdl-portal-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--hdl-muted, #6b7280);
  background: var(--hdl-surface-2, #f8f9fb);
  border-radius: var(--hdl-radius, 10px);
}

/* ── Loading / error ────────────────────────────────── */
.hdl-loading {
  text-align: center;
  padding: 32px;
  color: var(--hdl-muted, #6b7280);
}

.hdl-error-msg {
  padding: 12px 16px;
  background: #fee2e2;
  color: #991b1b;
  border-radius: var(--hdl-radius-sm, 6px);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.hdl-hidden { display: none !important; }

/* Honeypot */
.hdl-hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

@media (max-width: 600px) {
  .hdl-booking-header,
  .hdl-booking-body {
    padding-left: 20px;
    padding-right: 20px;
  }
  .hdl-slots {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* Reschedule / portal modals — always solid and readable */
.hdl-modal-overlay {
  background: rgba(15, 23, 42, 0.72) !important;
  opacity: 1 !important;
}
.hdl-modal-panel,
#hdl-reschedule-modal .hdl-card {
  background: #ffffff !important;
  opacity: 1 !important;
  color: #111827 !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35) !important;
}
#hdl-reschedule-modal label {
  color: #374151 !important;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}
#hdl-reschedule-modal .hdl-input,
#hdl-reschedule-modal input[type="date"] {
  background: #fff !important;
  color: #111 !important;
  border: 1px solid #d1d5db;
  opacity: 1 !important;
}
#hdl-rs-slots button {
  opacity: 1 !important;
}


/* Staff profile photos on booking form */
.hdl-staff-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hdl-staff-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  border: 1px solid var(--hdl-border, #e5e7eb);
  cursor: pointer;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.hdl-staff-pill.selected {
  border-color: var(--hdl-primary, #1B4F72);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--hdl-primary, #1B4F72) 25%, transparent);
}
.hdl-staff-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.hdl-staff-avatar-fallback {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}
.hdl-staff-name {
  font-weight: 600;
  font-size: 14px;
}


/* Portal profile + mobile app-like shell */
.hdl-customer-portal {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.hdl-portal-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.hdl-portal-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hdl-primary, #1B4F72);
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
}
.hdl-customer-portal .hdl-card {
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.06);
}
@media (max-width: 640px) {
  .hdl-booking-root,
  .hdl-customer-portal {
    padding: 12px;
  }
  .hdl-staff-pill {
    width: 100%;
    justify-content: flex-start;
  }
  .hdl-portal-actions .hdl-btn {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }
  .hdl-step-panels,
  .hdl-card {
    border-radius: 16px;
  }
}


/* ── Shared form utilities (public) ─────────────────── */
.hdl-card {
  background: var(--hdl-surface, #fff);
  border: 1px solid var(--hdl-border, rgba(0,0,0,0.08));
  border-radius: var(--hdl-radius, 12px);
  box-shadow: var(--hdl-shadow, 0 4px 24px rgba(0,0,0,0.06));
  padding: 24px;
}

.hdl-form-row {
  margin-bottom: 18px;
}

.hdl-form-row:last-of-type {
  margin-bottom: 22px;
}

.hdl-form-row label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hdl-muted, #6b7280);
  line-height: 1.3;
}

.hdl-form-row label input[type="checkbox"] {
  margin-right: 8px;
  vertical-align: middle;
  width: auto;
  text-transform: none;
  font-weight: 500;
}

.hdl-input,
input.hdl-input,
.hdl-form-row input[type="text"],
.hdl-form-row input[type="email"],
.hdl-form-row input[type="tel"],
.hdl-form-row input[type="password"],
.hdl-form-row input[type="url"],
.hdl-form-row input[type="date"],
.hdl-form-row select,
.hdl-form-row textarea {
  display: block;
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--hdl-border, rgba(0,0,0,0.12));
  border-radius: var(--hdl-radius-sm, 8px);
  background: var(--hdl-surface, #fff);
  font-size: 1rem;
  font-family: inherit;
  color: inherit;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  margin: 0;
}

.hdl-input:focus,
input.hdl-input:focus,
.hdl-form-row input:focus,
.hdl-form-row select:focus,
.hdl-form-row textarea:focus {
  outline: none;
  border-color: var(--hdl-primary, #1B4F72);
  box-shadow: 0 0 0 4px rgba(27, 79, 114, 0.12);
}

/* ── Portal auth (login / register) ─────────────────── */
.hdl-portal-auth {
  max-width: 440px;
  margin: 0 auto;
  padding: 8px 0 24px;
}

.hdl-portal-auth .hdl-portal-header {
  text-align: center;
  margin-bottom: 28px;
}

.hdl-portal-auth .hdl-portal-header h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hdl-primary, #1B4F72);
  line-height: 1.25;
}

.hdl-portal-auth .hdl-portal-header p {
  margin: 0 auto;
  max-width: 340px;
  color: var(--hdl-muted, #6b7280);
  font-size: 0.95rem;
  line-height: 1.5;
}

.hdl-auth-tabs {
  display: flex;
  gap: 0;
  margin: 0;
  background: var(--hdl-surface-2, #f8f9fb);
  border-radius: 12px 12px 0 0;
  border: 1px solid var(--hdl-border, rgba(0,0,0,0.08));
  border-bottom: none;
  overflow: hidden;
}

.hdl-auth-tab {
  flex: 1;
  text-align: center;
  padding: 14px 12px;
  text-decoration: none !important;
  color: var(--hdl-muted, #64748b);
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 3px solid transparent;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  background: transparent;
}

.hdl-auth-tab:hover {
  color: var(--hdl-primary, #1B4F72);
  background: rgba(255,255,255,0.6);
}

.hdl-auth-tab.is-active {
  color: var(--hdl-primary, #1B4F72);
  background: var(--hdl-surface, #fff);
  border-bottom-color: var(--hdl-primary, #1B4F72);
}

.hdl-auth-card {
  border-radius: 0 0 16px 16px;
  padding: 28px 28px 32px;
  border: 1px solid var(--hdl-border, rgba(0,0,0,0.08));
  border-top: none;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  background: var(--hdl-surface, #fff);
}

.hdl-auth-form .hdl-form-row {
  margin-bottom: 18px;
}

.hdl-auth-form .hdl-form-row:last-of-type {
  margin-bottom: 24px;
}

.hdl-auth-form .hdl-btn {
  margin-top: 4px;
}

.hdl-auth-form .hdl-form-row label:has(input[type="checkbox"]) {
  text-transform: none;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 0;
}

.hdl-portal-auth .hdl-notice {
  margin-bottom: 20px;
  border-radius: 10px;
}

.hdl-create-account-cta {
  text-align: center;
}

/* Auth form footer links */
.hdl-portal-auth > p {
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--hdl-muted, #6b7280);
  text-align: center;
  line-height: 1.5;
}

.hdl-portal-auth a {
  color: var(--hdl-primary, #1B4F72);
  text-decoration: none;
  font-weight: 500;
}

.hdl-portal-auth a:hover {
  text-decoration: underline;
}
