/* ============================================================
   layout.css — Agenda Externa Clinora (tema claro, wizard)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Tokens — idênticos ao sistema Clinora ─────────────────── */
:root {
  --bg:            #f0f4f8;
  --surface:       #ffffff;
  --surface-2:     #f8fafc;
  --border:        #e2e8f0;
  --border-hover:  #cbd5e1;
  --border-focus:  #1a6ff4;
  --text:          #1a202c;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;
  --accent:        #1a6ff4;
  --accent-hover:  #1558cc;
  --accent-light:  #eff6ff;
  --accent-border: #bfdbfe;
  --success:       #16a34a;
  --success-light: #f0fff4;
  --warning-light: #fffbeb;
  --warning-border:#fde68a;
  --warning-text:  #92400e;
  --danger:        #e53e3e;
  --danger-light:  #fff5f5;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-xs:     6px;
  --font:          'Inter', 'Montserrat', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.logo-clinora-container {
    border-right: 2px solid var(--cor-borda);
    padding: 0.5em 1em 0.5em 0em;
}

.clinora-logo {
    height: 30px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.logo-clinora-container-menu {
    border-right: 2px solid var(--cor-borda);
    padding: 0.5em 1em 0.5em 0em;
}

/* ── Header — mesmo padrão do topo Clinora ─────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand-icon {
  width: 36px;
  height: 36px;
  background: #eff6ff;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 16px;
  flex-shrink: 0;
}

.header-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.header-brand-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.header-brand-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  /* text-transform: uppercase; */
  line-height: 1;
}

/* ── Page Layout ───────────────────────────────────────────── */
.page-booking {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  padding: 32px 20px 60px;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card-booking {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.card-summary {
  width: 100%;
  max-width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: 84px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

/* ── Step Bar ──────────────────────────────────────────────── */
.step-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.step-bar .step {
  flex: 1;
  padding: 12px 6px 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  cursor: default;
  transition: background .15s, color .15s;
  line-height: 1.3;
  user-select: none;
}

.step-bar .step:last-child { border-right: none; }

.step-bar .step .step-num {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.step-bar .step.done {
  color: var(--accent);
  background: var(--accent-light);
  cursor: pointer;
}

.step-bar .step.done:hover { background: #dbeafe; }

.step-bar .step.active {
  color: #ffffff;
  background: var(--accent);
  cursor: default;
}

.step-bar .step.locked {
  color: var(--text-muted);
  opacity: .55;
  cursor: default;
}

/* ── Painéis de cada step ──────────────────────────────────── */
.step-panel {
  display: none;
  padding: 24px;
}

.step-panel.active { display: block; }

.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

/* ── Aviso CPF ─────────────────────────────────────────────── */
.notice-cpf {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  font-size: 13px;
  color: #1d4ed8;
  margin-bottom: 20px;
}

.notice-cpf i { font-size: 14px; flex-shrink: 0; }

/* ── Labels ────────────────────────────────────────────────── */
.section-label,
.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

.label-optional {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Select ────────────────────────────────────────────────── */
.form-select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  background: var(--surface) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") no-repeat right 12px center/12px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26,111,244,.1);
}

/* ── Inputs ────────────────────────────────────────────────── */
.form-control {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26,111,244,.1);
}

.form-control.is-valid  { border-color: var(--success); background: var(--success-light); }
.form-control.is-invalid{ border-color: var(--danger);  background: var(--danger-light); }

.invalid-feedback {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

.booking-alert {
  display: none;
  align-items: flex-start;
  gap: 12px;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.booking-alert--error {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}

.booking-alert__icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.booking-alert__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.booking-alert__content strong {
  font-size: 13px;
  font-weight: 700;
}

.booking-alert__content span {
  font-size: 13px;
  line-height: 1.5;
}

/* ── CPF row ───────────────────────────────────────────────── */
.cpf-input-row {
  display: flex;
  gap: 8px;
}

.cpf-input-row .form-control { flex: 1; }

#cpf-feedback { margin-top: 6px; }

.cpf-feedback-ok {
  font-size: 12px;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 4px;
}

.cpf-feedback-warn {
  background: var(--warning-light);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  color: var(--warning-text);
  font-size: 12px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

/* ── Cadastro box ──────────────────────────────────────────── */
.cadastro-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cadastro-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.cadastro-title i { color: var(--accent); font-size: 15px; }

/* ── Calendar ──────────────────────────────────────────────── */
.calendar-wrapper {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 16px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.calendar-nav-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color .15s, color .15s;
  font-size: 13px;
}

.calendar-nav-btn:hover { border-color: var(--border-hover); color: var(--text); }

.calendar-month {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.calendar-day-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0 8px;
  letter-spacing: .05em;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  font-size: 13px;
  cursor: pointer;
  transition: background .1s, color .1s;
  color: var(--text-secondary);
  user-select: none;
}

.calendar-day:hover:not(.disabled):not(.empty) { background: #f1f5f9; color: var(--text); }
.calendar-day.disabled, .calendar-day.empty    { color: var(--text-muted); cursor: default; opacity: .45; }
.calendar-day.today    { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.calendar-day.unavailable {
  background: #fff7ed;
  border: 1px dashed #fdba74;
  color: #c2410c;
  cursor: pointer;
  opacity: 1;
}
.calendar-day.unavailable:hover {
  background: #ffedd5;
  color: #9a3412;
}
.calendar-day.selected { background: var(--accent); color: #fff; font-weight: 600; }

.calendar-inline-message {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1200;
  max-width: 320px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
}

.calendar-inline-message.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.calendar-inline-message-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.96);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.34);
}

.calendar-inline-message-content i {
  font-size: 15px;
  color: #bfdbfe;
  flex-shrink: 0;
  margin-top: 2px;
}

.calendar-inline-message-arrow {
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: rgba(15, 23, 42, 0.96);
  transform: translateX(-50%) rotate(45deg);
}

.calendar-inline-message--below .calendar-inline-message-arrow {
  top: -7px;
  bottom: auto;
}

/* ── Time Slots ────────────────────────────────────────────── */
.time-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 4px;
}

.time-slot {
  padding: 10px 4px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background .1s, border-color .1s, color .1s;
}

.time-slot:hover    { background: #f1f5f9; border-color: var(--border-hover); color: var(--text); }
.time-slot.selected { background: var(--accent-light); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ── Panel footer ──────────────────────────────────────────── */
.panel-footer {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.btn-next {
  flex: 1;
  padding: 11px 16px;
  border-radius: var(--radius-xs);
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.btn-next:hover:not(:disabled) { background: var(--accent-hover); }
.btn-next:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }

.btn-back {
  padding: 11px 16px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}

.btn-back:hover { background: var(--surface-2); }

.btn-confirm-final { flex: 1; }

/* ── Summary Card ──────────────────────────────────────────── */
.summary-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
}

.summary-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.summary-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-item-icon i { color: var(--accent); font-size: 14px; }

.summary-item-content strong {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 2px;
}

.summary-item-content span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.summary-item-content span.empty {
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 820px) {
  .page-booking {
    flex-direction: column;
    align-items: center;
    padding: 20px 16px 60px;
  }
  .card-summary {
    position: static;
    max-width: 520px;
    order: -1;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .time-grid { grid-template-columns: repeat(3, 1fr); }
  .step-bar .step { font-size: 10px; padding: 10px 4px 8px; }
  .step-bar .step .step-num { font-size: 13px; }
  .header { padding: 0 16px; }
  .header-brand-sub { display: none; }
}

/* ── Sucesso ────────────────────────────────────────────────── */
.page-booking--center {
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
}

.card-success {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 52px 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 1.5px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.success-icon i { font-size: 28px; color: var(--accent); }

.success-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.3;
}

.success-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}