/* ── Appointment Manager – Frontend Styles ─────────────────────────────── */

:root {
  --apm-primary:   #2C5F2E;
  --apm-accent:    #97BC62;
  --apm-bg:        #F9FAF7;
  --apm-card:      #FFFFFF;
  --apm-border:    #E2E8DA;
  --apm-text:      #1A2416;
  --apm-muted:     #6B7B62;
  --apm-radius:    12px;
  --apm-shadow:    0 2px 16px rgba(44,95,46,.10);
  --apm-font:      'Georgia', 'Times New Roman', serif;
  --apm-sans:      -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.apm-booking-wrap,
.apm-account-wrap,
.apm-auth-wrap,
.apm-type-list {
  font-family: var(--apm-sans);
  color: var(--apm-text);
  max-width: 680px;
  margin: 0 auto;
}

/* ── Steps ─────────────────────────────────────────────────────────────── */
.apm-step { animation: apmFadeIn .25s ease; }
@keyframes apmFadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

.apm-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.apm-step-title {
  margin: 0 0 20px;
  font-size: 1.3rem;
  font-family: var(--apm-font);
  color: var(--apm-primary);
}
.apm-step-header .apm-step-title { margin: 0; }

.apm-back-btn {
  background: none;
  border: 1px solid var(--apm-border);
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  color: var(--apm-muted);
  font-size: .875rem;
  transition: all .15s;
}
.apm-back-btn:hover { background: var(--apm-bg); color: var(--apm-primary); }

/* ── Type cards ──────────────────────────────────────────────────────────*/
.apm-type-grid {
  display: grid;
  gap: 12px;
}

.apm-type-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--apm-card);
  border: 2px solid var(--apm-border);
  border-radius: var(--apm-radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.apm-type-card:hover {
  border-color: var(--type-color, var(--apm-accent));
  box-shadow: var(--apm-shadow);
  transform: translateY(-2px);
}

.apm-type-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--type-color, var(--apm-accent));
  flex-shrink: 0;
}
.apm-type-info { flex: 1; }
.apm-type-info strong { display: block; font-size: 1.05rem; }
.apm-type-desc { display: block; font-size: .85rem; color: var(--apm-muted); margin: 3px 0 6px; }
.apm-type-meta { font-size: .82rem; color: var(--apm-muted); display: flex; gap: 12px; }
.apm-type-arrow { color: var(--apm-muted); font-size: 1.2rem; }

/* ── Calendar ────────────────────────────────────────────────────────────*/
.apm-calendar-wrap {
  background: var(--apm-card);
  border: 1px solid var(--apm-border);
  border-radius: var(--apm-radius);
  padding: 20px;
  box-shadow: var(--apm-shadow);
}

.apm-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.apm-cal-btn {
  background: var(--apm-bg);
  border: 1px solid var(--apm-border);
  border-radius: 8px;
  width: 36px; height: 36px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--apm-primary);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.apm-cal-btn:hover { background: var(--apm-accent); color: #fff; }

.apm-cal-month-label {
  font-size: 1rem;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--apm-primary);
}

.apm-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.apm-cal-wday {
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--apm-muted);
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.apm-cal-grid {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  gap: 4px;
}

.apm-cal-day {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  cursor: default;
  transition: background .15s, color .15s;
  position: relative;
}
.apm-cal-day.apm-cal-empty { background: transparent; }
.apm-cal-day.apm-cal-past  { color: #ccc; }
.apm-cal-day.apm-cal-available {
  background: var(--apm-bg);
  color: var(--apm-primary);
  cursor: pointer;
  font-weight: 600;
  border: 1px solid var(--apm-border);
}
.apm-cal-day.apm-cal-available:hover,
.apm-cal-day.apm-cal-available:focus {
  background: var(--apm-primary);
  color: #fff;
  border-color: var(--apm-primary);
}
.apm-cal-day.apm-cal-selected {
  background: var(--apm-primary) !important;
  color: #fff !important;
  border-color: var(--apm-primary) !important;
}
.apm-cal-day.apm-cal-today::after {
  content: '';
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--apm-accent);
}
.apm-cal-loading { grid-column: 1/-1; text-align: center; padding: 30px; color: var(--apm-muted); font-size: .9rem; }

/* ── Time slots ──────────────────────────────────────────────────────────*/
.apm-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.apm-slot {
  background: var(--apm-card);
  border: 2px solid var(--apm-border);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--apm-primary);
  transition: all .15s;
}
.apm-slot:hover {
  background: var(--apm-primary);
  color: #fff;
  border-color: var(--apm-primary);
  transform: translateY(-2px);
}
.apm-no-slots { color: var(--apm-muted); font-size: .9rem; grid-column: 1/-1; padding: 20px 0; }

/* ── Badges ──────────────────────────────────────────────────────────────*/
.apm-selected-type-badge,
.apm-selected-date-badge {
  background: var(--apm-bg);
  border: 1px solid var(--apm-border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .82rem;
  color: var(--apm-primary);
  font-weight: 600;
}

/* ── Booking summary ─────────────────────────────────────────────────────*/
.apm-booking-summary {
  background: var(--apm-bg);
  border-left: 4px solid var(--apm-accent);
  border-radius: 0 var(--apm-radius) var(--apm-radius) 0;
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: .9rem;
  color: var(--apm-text);
  line-height: 1.7;
}
.apm-booking-summary strong { color: var(--apm-primary); }

/* ── Form fields ─────────────────────────────────────────────────────────*/
.apm-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
.apm-field { display: flex; flex-direction: column; gap: 6px; }
.apm-field-full { grid-column: 1 / -1; }
.apm-field label { font-size: .82rem; font-weight: 600; color: var(--apm-muted); text-transform: uppercase; letter-spacing: .05em; }
.apm-field input,
.apm-field textarea,
.apm-field select {
  padding: 10px 14px;
  border: 1.5px solid var(--apm-border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  color: var(--apm-text);
  background: #fff;
  transition: border-color .15s;
  outline: none;
}
.apm-field input:focus,
.apm-field textarea:focus {
  border-color: var(--apm-primary);
  box-shadow: 0 0 0 3px rgba(44,95,46,.12);
}

/* ── Account options ─────────────────────────────────────────────────────*/
.apm-account-option {
  background: var(--apm-bg);
  border: 1px solid var(--apm-border);
  border-radius: var(--apm-radius);
  padding: 16px;
  margin-bottom: 20px;
}
.apm-checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; }
.apm-account-fields { margin-top: 12px; }

/* ── Buttons ─────────────────────────────────────────────────────────────*/
.apm-submit-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--apm-primary);
  color: #fff;
  border: none;
  border-radius: var(--apm-radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .03em;
  transition: background .2s, transform .15s;
}
.apm-submit-btn:hover   { background: #234b25; transform: translateY(-1px); }
.apm-submit-btn:disabled { background: #aaa; cursor: not-allowed; transform: none; }

.apm-new-btn {
  margin-top: 16px;
  padding: 10px 24px;
  background: var(--apm-bg);
  border: 1.5px solid var(--apm-border);
  border-radius: var(--apm-radius);
  color: var(--apm-primary);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  transition: all .15s;
}
.apm-new-btn:hover { background: var(--apm-primary); color: #fff; }

/* ── Done screen ─────────────────────────────────────────────────────────*/
#apm-step-done { text-align: center; padding: 40px 20px; }
.apm-done-icon { font-size: 3rem; margin-bottom: 12px; }
.apm-done-msg  { font-size: 1rem; color: var(--apm-text); margin: 12px 0; }
.apm-done-hint { font-size: .88rem; color: var(--apm-muted); }

/* ── Error ───────────────────────────────────────────────────────────────*/
.apm-error {
  background: #FFF5F5;
  border: 1px solid #FCA5A5;
  border-radius: 8px;
  padding: 10px 14px;
  color: #991B1B;
  font-size: .875rem;
  margin-bottom: 14px;
}

/* ── My account ──────────────────────────────────────────────────────────*/
.apm-account-title { font-family: var(--apm-font); color: var(--apm-primary); margin-bottom: 4px; }
.apm-logout-link   { font-size: .85rem; color: var(--apm-muted); }
.apm-no-appointments { color: var(--apm-muted); }

.apm-appt-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }

.apm-appt-card {
  display: flex;
  gap: 16px;
  background: var(--apm-card);
  border: 1.5px solid var(--apm-border);
  border-left: 5px solid var(--type-color, var(--apm-accent));
  border-radius: var(--apm-radius);
  padding: 16px 20px;
  align-items: flex-start;
}
.apm-appt-cancelled { opacity: .55; }

.apm-appt-date-col  { text-align: center; min-width: 52px; }
.apm-appt-day       { display: block; font-size: 1.8rem; font-weight: 800; color: var(--apm-primary); line-height: 1; }
.apm-appt-month     { display: block; font-size: .75rem; text-transform: uppercase; color: var(--apm-muted); letter-spacing: .05em; }
.apm-appt-year      { display: block; font-size: .75rem; color: var(--apm-muted); }

.apm-appt-info-col  { flex: 1; }
.apm-appt-type      { font-weight: 700; font-size: 1rem; color: var(--apm-primary); }
.apm-appt-time      { font-size: .88rem; color: var(--apm-muted); margin-top: 4px; }
.apm-appt-notes     { font-size: .82rem; color: var(--apm-muted); margin-top: 6px; font-style: italic; }

.apm-appt-status-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.apm-appt-status-confirmed { background: #D1FAE5; color: #065F46; }
.apm-appt-status-cancelled { background: #FEE2E2; color: #991B1B; }
.apm-appt-status-completed { background: #EDE9FE; color: #5B21B6; }

.apm-cancel-btn {
  background: none;
  border: 1px solid #FCA5A5;
  color: #DC2626;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .8rem;
  cursor: pointer;
  transition: all .15s;
}
.apm-cancel-btn:hover { background: #DC2626; color: #fff; border-color: #DC2626; }

/* ── Auth tabs ───────────────────────────────────────────────────────────*/
.apm-auth-wrap {
  background: var(--apm-card);
  border: 1px solid var(--apm-border);
  border-radius: var(--apm-radius);
  padding: 30px;
  box-shadow: var(--apm-shadow);
  max-width: 460px;
}
.apm-auth-tabs { display: flex; gap: 0; margin-bottom: 24px; }
.apm-auth-tab {
  flex: 1;
  padding: 10px;
  background: var(--apm-bg);
  border: 1px solid var(--apm-border);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  color: var(--apm-muted);
  transition: all .15s;
}
.apm-auth-tab:first-child { border-radius: var(--apm-radius) 0 0 var(--apm-radius); }
.apm-auth-tab:last-child  { border-radius: 0 var(--apm-radius) var(--apm-radius) 0; }
.apm-auth-tab.active { background: var(--apm-primary); color: #fff; border-color: var(--apm-primary); }
.apm-auth-hint { font-size: .85rem; color: var(--apm-muted); margin-top: 16px; }
.apm-auth-hint a { color: var(--apm-primary); }

/* ── Type list ───────────────────────────────────────────────────────────*/
.apm-type-list { display: grid; gap: 14px; }
.apm-type-list-card {
  display: flex;
  background: var(--apm-card);
  border: 1px solid var(--apm-border);
  border-radius: var(--apm-radius);
  overflow: hidden;
  box-shadow: var(--apm-shadow);
}
.apm-type-list-color-bar { width: 6px; background: var(--type-color, var(--apm-accent)); flex-shrink: 0; }
.apm-type-list-body { padding: 16px 20px; }
.apm-type-list-body h4 { margin: 0 0 6px; color: var(--apm-primary); font-size: 1.05rem; }
.apm-type-list-body p  { margin: 0 0 10px; font-size: .9rem; color: var(--apm-muted); }
.apm-type-list-meta { font-size: .82rem; color: var(--apm-muted); display: flex; gap: 16px; }

/* ── Logged in note ──────────────────────────────────────────────────────*/
.apm-logged-in-note {
  background: var(--apm-bg);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .88rem;
  color: var(--apm-muted);
  margin-bottom: 18px;
}
.apm-logged-in-note a { color: var(--apm-primary); margin-left: 10px; }

/* ── Responsive ──────────────────────────────────────────────────────────*/
@media (max-width: 560px) {
  .apm-fields { grid-template-columns: 1fr; }
  .apm-appt-card { flex-direction: column; }
  .apm-slots-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
}

/* ── Betaallink op done-scherm ─────────────────────────────── */
.apm-pay-link {
  display: inline-block;
  margin-top: 10px;
  padding: 12px 24px;
  background: var(--apm-primary);
  color: #fff;
  border-radius: var(--apm-radius);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: background .2s;
}
.apm-pay-link:hover { background: #234b25; color: #fff; }
.apm-slot.apm-slot-taken {
  background: var(--apm-bg);
  border-color: var(--apm-border);
  color: #bbb;
  cursor: not-allowed;
  position: relative;
}
.apm-slot.apm-slot-taken::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  height: 1.5px;
  background: #ccc;
  transform: translateY(-50%);
}
.apm-slot-label {
  display: block;
  font-size: .68rem;
  font-weight: 400;
  opacity: .7;
  margin-top: 2px;
}

/* ── "Op aanvraag" badge op type-card ──────────────────────── */
.apm-type-pending-badge {
  display: inline-block;
  background: #FEF3C7;
  color: #92400E;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 8px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Pending notice in booking summary ─────────────────────── */
.apm-pending-note {
  margin-top: 8px;
  padding: 8px 12px;
  background: #FEF3C7;
  border-left: 3px solid #F59E0B;
  border-radius: 0 8px 8px 0;
  font-size: .82rem;
  color: #92400E;
  line-height: 1.5;
}

/* ── Field inline error ─────────────────────────────────────── */
.apm-field-error {
  display: block;
  font-size: .78rem;
  color: #dc2626;
  margin-top: 3px;
}

/* ── Niet-beschikbare kalenderdagen ────────────────────────── */
.apm-cal-day.apm-cal-unavailable {
  color: #ccc;
  cursor: default;
  background: transparent;
}
