:root {
  --primary: #1a6b8a;
  --primary-dark: #134f68;
  --accent: #2cb5a0;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1e2d3d;
  --muted: #6b7c93;
  --border: #d8e2ec;
  --available: #e8f5e9;
  --available-border: #4caf50;
  --taken: #f5f5f5;
  --taken-text: #bbb;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  background: var(--primary);
  color: white;
  padding: 20px 24px;
  text-align: center;
}

header h1 { font-size: 1.4rem; font-weight: 700; }
header p { font-size: 0.9rem; opacity: 0.85; margin-top: 4px; }

.container { max-width: 900px; margin: 0 auto; padding: 24px 16px; }

/* Navegação de semana */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
}

.week-nav button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.week-nav button:hover { background: var(--primary-dark); }
.week-nav button:disabled { background: #ccc; cursor: not-allowed; }
.week-nav span { font-weight: 600; color: var(--primary); font-size: 0.95rem; }

/* Grade de dias */
.days-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .days-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 360px) {
  .days-grid { grid-template-columns: 1fr; }
}

.day-column {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.day-header {
  background: var(--primary);
  color: white;
  padding: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.day-date {
  font-size: 0.75rem;
  opacity: 0.85;
  margin-top: 2px;
}

.slot-list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }

.slot-btn {
  width: 100%;
  padding: 10px 8px;
  border-radius: 6px;
  border: 1.5px solid var(--available-border);
  background: var(--available);
  color: #2e7d32;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.slot-btn:hover {
  background: #c8e6c9;
  transform: translateY(-1px);
}
.slot-btn.taken {
  background: var(--taken);
  border-color: var(--border);
  color: var(--taken-text);
  cursor: not-allowed;
}
.slot-btn.taken:hover { transform: none; }

.loading { text-align: center; padding: 40px; color: var(--muted); }
.empty { text-align: center; padding: 30px; color: var(--muted); font-size: 0.9rem; }

/* Formulário de agendamento */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  max-width: 500px;
  margin: 0 auto;
}

.card h2 { font-size: 1.2rem; color: var(--primary); margin-bottom: 6px; }
.slot-info { background: #e3f2fd; border-radius: 6px; padding: 10px 14px; margin-bottom: 20px; font-size: 0.9rem; color: #1a6b8a; font-weight: 600; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.form-group textarea { resize: vertical; min-height: 80px; }

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #aaa; cursor: not-allowed; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-error { background: #fdecea; color: #c62828; border: 1px solid #ef9a9a; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }

/* Confirmação */
.confirm-icon { font-size: 4rem; text-align: center; margin: 20px 0 10px; }
.confirm-details { background: #f0f4f8; border-radius: 8px; padding: 16px; margin: 16px 0; }
.confirm-details p { margin: 6px 0; font-size: 0.95rem; }
.confirm-details strong { color: var(--primary); }

.btn-secondary {
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 12px;
  transition: background 0.2s;
}
.btn-secondary:hover { background: #229e8b; }

.btn-video {
  display: inline-block;
  width: 100%;
  padding: 13px;
  background: #1565c0;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  transition: background 0.2s;
}
.btn-video:hover { background: #0d47a1; }

.back-link { display: block; text-align: center; margin-top: 16px; color: var(--muted); font-size: 0.9rem; text-decoration: none; }
.back-link:hover { color: var(--primary); }

/* ── Formulário multi-passo ─────────────────────────────────── */

/* Barra de progresso */
.steps-progress {
  display: flex;
  align-items: center;
  margin: 4px 0 24px;
  gap: 0;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, color 0.25s;
}
.step-item span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.step-item.active .step-num   { background: var(--primary); color: #fff; }
.step-item.active span        { color: var(--primary); font-weight: 700; }
.step-item.completed .step-num { background: var(--accent); color: #fff; }
.step-item.completed span     { color: var(--accent); }
.step-sep {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-bottom: 18px;
  min-width: 12px;
}

/* Painéis de passo */
.step-panel        { display: none; }
.step-panel.active { display: block; }
.step-panel h2     { font-size: 1.1rem; color: var(--primary); margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid var(--border); }

/* Grade de 2 colunas */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

/* Slider de dor */
.pain-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(to right, #43a047, #fdd835, #e53935);
  outline: none;
  padding: 0;
  border: none;
  margin-top: 6px;
}
.pain-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.pain-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 3px;
}

/* Caixa TCLE */
.tcle-box {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 18px;
  font-size: 0.83rem;
  line-height: 1.65;
  color: #374151;
}
.tcle-box p  { margin-bottom: 10px; }
.tcle-box ol { padding-left: 18px; margin: 10px 0; }
.tcle-box li { margin-bottom: 7px; }

/* Checkbox de aceite */
.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}
.check-label input[type="checkbox"] {
  width: 17px; height: 17px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

/* Navegação de passos */
.step-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1.5px solid var(--border);
}
.btn-back {
  background: none;
  color: var(--muted);
  border: 1.5px solid var(--border);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  margin-right: auto;
}
.btn-back:hover { border-color: var(--muted); color: var(--text); }
.step-btn { width: auto; padding: 11px 24px; }
