/* =========================================================
   KGH Reparatie — Frontend Stijlen
   ========================================================= */

:root {
  --kgh-primary:  #1a1a2e;
  --kgh-accent:   #4f6ef0;
  --kgh-success:  #22c55e;
  --kgh-error:    #ef4444;
  --kgh-warning:  #f59e0b;
  --kgh-border:   #e2e8f0;
  --kgh-bg:       #f8fafc;
  --kgh-radius:   8px;
  --kgh-shadow:   0 2px 8px rgba(0,0,0,.08);
}

/* ─── Wrapper ──────────────────────────────────────────── */
.kgh-repair-form-wrap,
.kgh-repair-my-appointments,
.kgh-repair-appointment-detail,
.kgh-repair-status-tracker {
  max-width: 860px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.6;
}

/* ─── Stap-indicator ───────────────────────────────────── */
.kgh-repair-steps {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.kgh-repair-step {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 80px;
  padding: 10px 8px;
  background: var(--kgh-bg);
  border: 2px solid var(--kgh-border);
  border-radius: var(--kgh-radius);
  font-size: 13px;
  color: #94a3b8;
  cursor: default;
  transition: all .15s;
}

.kgh-repair-step__number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--kgh-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  flex-shrink: 0;
}

.kgh-repair-step.active {
  border-color: var(--kgh-primary);
  color: var(--kgh-primary);
  background: #fff;
}

.kgh-repair-step.active .kgh-repair-step__number {
  background: var(--kgh-primary);
  color: #fff;
}

.kgh-repair-step.completed {
  border-color: var(--kgh-success);
  color: var(--kgh-success);
}

.kgh-repair-step.completed .kgh-repair-step__number {
  background: var(--kgh-success);
  color: #fff;
}

/* ─── Form stap ────────────────────────────────────────── */
.kgh-repair-form-step {
  display: none;
  background: #fff;
  border: 1px solid var(--kgh-border);
  border-radius: var(--kgh-radius);
  padding: 28px;
  box-shadow: var(--kgh-shadow);
}

.kgh-repair-form-step.active { display: block; }

.kgh-repair-form-step h2 {
  margin-top: 0;
  font-size: 20px;
  color: var(--kgh-primary);
  border-bottom: 2px solid var(--kgh-border);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

/* ─── Form navigatie ───────────────────────────────────── */
.kgh-repair-form-nav {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--kgh-border);
  justify-content: space-between;
}

/* ─── Knoppen ──────────────────────────────────────────── */
.kgh-repair-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: all .15s;
  line-height: 1;
}

.kgh-repair-btn--primary  { background: var(--kgh-primary); color: #fff; }
.kgh-repair-btn--primary:hover { background: #2a2a4e; color: #fff; }

.kgh-repair-btn--secondary { background: #fff; color: var(--kgh-primary); border-color: var(--kgh-primary); }
.kgh-repair-btn--secondary:hover { background: var(--kgh-bg); }

.kgh-repair-btn--ghost { background: transparent; color: #64748b; border-color: var(--kgh-border); }
.kgh-repair-btn--ghost:hover { background: var(--kgh-bg); }

.kgh-repair-btn--success { background: var(--kgh-success); color: #fff; padding: 14px 32px; font-size: 16px; }
.kgh-repair-btn--success:hover { background: #16a34a; color: #fff; }

.kgh-repair-btn--small { padding: 6px 14px; font-size: 13px; }

.kgh-repair-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ─── Form velden ──────────────────────────────────────── */
.kgh-repair-field {
  margin-bottom: 18px;
}

.kgh-repair-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--kgh-primary);
}

.kgh-repair-field input[type="text"],
.kgh-repair-field input[type="email"],
.kgh-repair-field input[type="number"],
.kgh-repair-field textarea,
.kgh-repair-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--kgh-border);
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color .15s;
}

.kgh-repair-field input:focus,
.kgh-repair-field textarea:focus,
.kgh-repair-field select:focus {
  border-color: var(--kgh-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79,110,240,.1);
}

.kgh-repair-field-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.kgh-repair-help-text { font-size: 13px; color: #64748b; margin-top: 4px; }
.kgh-repair-required  { color: var(--kgh-error); margin-left: 2px; }

/* ─── Item kaart ───────────────────────────────────────── */
.kgh-repair-item-card {
  background: var(--kgh-bg);
  border: 1px solid var(--kgh-border);
  border-radius: var(--kgh-radius);
  padding: 20px;
  margin-bottom: 16px;
}

.kgh-repair-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.kgh-repair-item-title { margin: 0; font-size: 16px; color: var(--kgh-primary); }

.kgh-repair-remove-item {
  background: none;
  border: 1px solid var(--kgh-error);
  color: var(--kgh-error);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

/* ─── Radio buttons ────────────────────────────────────── */
.kgh-repair-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kgh-repair-radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 12px;
  border: 2px solid var(--kgh-border);
  border-radius: 6px;
  transition: border-color .15s;
}

.kgh-repair-radio:has(input:checked) {
  border-color: var(--kgh-primary);
  background: #f0f4ff;
}

.kgh-repair-radio input[type="radio"] {
  margin-top: 2px;
  flex-shrink: 0;
}

/* ─── Tarief display ───────────────────────────────────── */
.kgh-repair-fee-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  border-radius: var(--kgh-radius);
  text-align: center;
  margin-top: 16px;
}

.kgh-repair-fee-box--paid {
  background: #fff7ed;
  border: 2px solid var(--kgh-warning);
}

.kgh-repair-fee-box--free {
  background: #f0fdf4;
  border: 2px solid var(--kgh-success);
}

.kgh-repair-fee-label { font-size: 13px; color: #64748b; }

.kgh-repair-fee-amount {
  font-size: 32px;
  font-weight: bold;
  color: var(--kgh-primary);
  margin: 4px 0;
}

.kgh-repair-fee-amount--free { color: var(--kgh-success); }

.kgh-repair-fee-note { font-size: 13px; color: #64748b; }

/* ─── Leen-toestel ─────────────────────────────────────── */
.kgh-repair-loan-terms {
  background: #fff7ed;
  border: 1px solid var(--kgh-warning);
  border-radius: var(--kgh-radius);
  padding: 20px;
  margin-top: 16px;
}

.kgh-repair-loan-terms ul { padding-left: 0; list-style: none; }
.kgh-repair-loan-terms li { margin-bottom: 10px; }

/* ─── Checkboxes ───────────────────────────────────────── */
.kgh-repair-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  line-height: 1.4;
}

.kgh-repair-checkbox input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ─── Datum kiezer ─────────────────────────────────────── */
.kgh-repair-date-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 16px;
}

.kgh-repair-date-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 14px;
  border: 2px solid var(--kgh-border);
  border-radius: var(--kgh-radius);
  background: #fff;
  cursor: pointer;
  min-width: 70px;
  transition: all .15s;
}

.kgh-repair-date-btn:hover { border-color: var(--kgh-accent); }
.kgh-repair-date-btn.selected { border-color: var(--kgh-primary); background: var(--kgh-primary); color: #fff; }

.kgh-date-day   { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.kgh-date-num   { font-size: 22px; font-weight: bold; line-height: 1; }
.kgh-date-month { font-size: 12px; }

/* ─── Tijdsloten ───────────────────────────────────────── */
.kgh-repair-slot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.kgh-repair-slot-btn {
  padding: 10px 16px;
  border: 2px solid var(--kgh-border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all .15s;
}

.kgh-repair-slot-btn:hover { border-color: var(--kgh-accent); }
.kgh-repair-slot-btn.selected { background: var(--kgh-primary); color: #fff; border-color: var(--kgh-primary); }

/* ─── Voorwaarden ──────────────────────────────────────── */
.kgh-repair-terms-box {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--kgh-border);
  border-radius: 6px;
  padding: 16px;
  background: var(--kgh-bg);
  font-size: 14px;
  margin-bottom: 20px;
}

/* ─── Samenvatting ─────────────────────────────────────── */
.kgh-repair-summary-table {
  width: 100%;
  border-collapse: collapse;
}

.kgh-repair-summary-table th,
.kgh-repair-summary-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--kgh-border);
  text-align: left;
}

.kgh-repair-summary-table th {
  width: 160px;
  color: #64748b;
  font-weight: 500;
}

/* ─── Status badges ────────────────────────────────────── */
.kgh-repair-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.kgh-repair-status-badge--large {
  padding: 8px 20px;
  font-size: 15px;
}

/* ─── Tabel ────────────────────────────────────────────── */
.kgh-repair-table {
  width: 100%;
  border-collapse: collapse;
}

.kgh-repair-table th,
.kgh-repair-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--kgh-border);
  text-align: left;
}

.kgh-repair-table th {
  background: var(--kgh-bg);
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ─── Detail pagina ────────────────────────────────────── */
.kgh-repair-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.kgh-repair-ticket-number {
  font-size: 22px;
  font-weight: bold;
  color: var(--kgh-primary);
  margin: 4px 0 0;
  letter-spacing: 1px;
}

.kgh-repair-detail-card {
  background: #fff;
  border: 1px solid var(--kgh-border);
  border-radius: var(--kgh-radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--kgh-shadow);
}

.kgh-repair-detail-card h3 {
  margin-top: 0;
  font-size: 16px;
  color: var(--kgh-primary);
  border-bottom: 1px solid var(--kgh-border);
  padding-bottom: 10px;
}

.kgh-repair-detail-list {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 6px 12px;
  margin: 0;
}

.kgh-repair-detail-list dt { font-weight: 600; color: #64748b; }

/* ─── Timeline ─────────────────────────────────────────── */
.kgh-repair-timeline { padding: 8px 0; }

.kgh-repair-timeline-entry {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--kgh-border);
}

.kgh-repair-timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 3px;
  flex-shrink: 0;
}

.kgh-repair-timeline-date { font-size: 12px; color: #94a3b8; margin-left: 8px; }
.kgh-repair-timeline-note { font-size: 13px; color: #64748b; margin: 4px 0 0; }

/* ─── Foto's ───────────────────────────────────────────── */
.kgh-repair-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.kgh-repair-photo-thumb img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--kgh-border);
}

.kgh-repair-photo-preview {
  position: relative;
  width: 80px;
  height: 80px;
}

.kgh-repair-photo-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.kgh-repair-photo-preview--loading {
  background: var(--kgh-bg);
  border: 1px dashed var(--kgh-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kgh-remove-photo {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--kgh-error);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* ─── Notices ──────────────────────────────────────────── */
.kgh-repair-notice {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

.kgh-repair-notice--error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.kgh-repair-notice--success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; }
.kgh-repair-notice--info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

.kgh-repair-field-message { margin-top: 6px; font-size: 13px; }
.kgh-field-msg--success   { color: var(--kgh-success); }
.kgh-field-msg--error     { color: var(--kgh-error); }

/* ─── Login prompt ─────────────────────────────────────── */
.kgh-repair-login-prompt {
  text-align: center;
  padding: 40px 20px;
  background: #fff;
  border: 1px solid var(--kgh-border);
  border-radius: var(--kgh-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ─── Input rij ────────────────────────────────────────── */
.kgh-repair-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.kgh-repair-input-row input { flex: 1; }

/* ─── Tracker ──────────────────────────────────────────── */
.kgh-repair-ticket-search { max-width: 480px; }
.kgh-repair-ticket-input  { padding: 10px 14px; border: 1px solid var(--kgh-border); border-radius: 6px; font-size: 15px; flex: 1; }

/* ─── Loading ──────────────────────────────────────────── */
.kgh-repair-loading { color: #94a3b8; font-style: italic; }

/* ─── Hulp teksten ─────────────────────────────────────── */
.kgh-repair-free     { color: var(--kgh-success); font-weight: 600; }
.kgh-repair-returned { color: var(--kgh-success); }
.kgh-repair-on-loan  { color: var(--kgh-warning); }

/* ─── Leeg ─────────────────────────────────────────────── */
.kgh-repair-empty {
  padding: 40px;
  text-align: center;
  background: var(--kgh-bg);
  border-radius: var(--kgh-radius);
}

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
  .kgh-repair-field-row { grid-template-columns: 1fr; }
  .kgh-repair-detail-list { grid-template-columns: 1fr; }
  .kgh-repair-detail-list dt { margin-top: 8px; }
  .kgh-repair-steps { gap: 4px; }
  .kgh-repair-step__label { display: none; }
  .kgh-repair-form-step { padding: 16px; }
  .kgh-repair-date-btn { min-width: 60px; padding: 8px; }
  .kgh-date-num { font-size: 18px; }
  .kgh-repair-form-nav { flex-direction: column; }
  .kgh-repair-btn { width: 100%; justify-content: center; }
  .kgh-repair-detail-header { flex-direction: column; }
}
