/* =====================================================================
   Sistema de Agendamento Odontológico — Estilo global
   Cores da marca: definidas em <style> no header via clinic_info
   (--primary e --secondary). Aqui ficam os derivados e o restante.
   ===================================================================== */

:root {
  /* Fallbacks (sobrescritos pelo painel white-label) */
  --primary: #0e7490;
  --secondary: #14b8a6;

  --ink: #0f172a;
  --ink-soft: #475569;
  --muted: #64748b;
  --bg: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --danger: #dc2626;
  --ok-bg: #ecfdf5;
  --ok-ink: #047857;
  --err-bg: #fef2f2;
  --err-ink: #b91c1c;
  --info-bg: #eff6ff;
  --info-ink: #1d4ed8;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(15, 23, 42, .07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: var(--primary); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; }
.container-form { max-width: 460px; }
.container-form-wide { max-width: 720px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.inline { display: inline; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.1rem; }
.brand-logo { height: 40px; width: auto; }
.brand-icon { font-size: 1.6rem; }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .95rem; }
.nav a:hover { color: var(--primary); }
.nav-toggle { display: none; }
.nav-burger { display: none; }

/* ---------- Botões ---------- */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none; text-align: center;
  font: inherit; font-weight: 700; font-size: .95rem;
  padding: 10px 20px; border-radius: 999px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; }
.btn-primary { background: var(--primary); color: #fff !important; box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-outline { background: transparent; color: var(--primary) !important; border: 2px solid var(--primary); }
.btn-ghost { background: transparent; color: var(--ink-soft) !important; border: 2px solid var(--line); }
.btn-light { background: #fff; color: var(--primary) !important; }
.btn-danger { background: transparent; color: var(--danger) !important; border: 2px solid #fecaca; }
.btn-danger:hover { background: var(--err-bg); }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-sm { padding: 5px 12px; font-size: .82rem; }
.btn-block { display: block; width: 100%; margin-top: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 72px 0;
}
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; gap: 40px; }
.hero-badge {
  display: inline-block; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
  padding: 5px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600; margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); font-weight: 800; }
.hero-slogan { font-size: 1.15rem; opacity: .95; max-width: 34rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0; }
.hero-points { list-style: none; padding: 0; margin: 0; opacity: .95; font-size: .95rem; }
.hero-points li { margin: 4px 0; }
.hero-art { display: flex; justify-content: center; }
.hero-circle {
  width: 230px; height: 230px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: 2px dashed rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center; font-size: 90px;
}

/* ---------- Seções ---------- */
.section { padding: 64px 0; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin-bottom: 12px; }
.section-lead { max-width: 46rem; color: var(--ink-soft); font-size: 1.05rem; }
.section-sub { color: var(--muted); margin-top: -6px; margin-bottom: 24px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card h3 { font-size: 1.1rem; }
.card-desc { color: var(--ink-soft); font-size: .95rem; }
.card-meta { display: flex; align-items: center; justify-content: space-between; margin: 14px 0; }
.chip { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.price { color: var(--primary); font-size: 1.15rem; }

.card-team { display: flex; gap: 18px; align-items: flex-start; }
.team-photo { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.team-photo-placeholder { display: flex; align-items: center; justify-content: center; font-size: 44px; background: var(--bg); border: 1px solid var(--line); }
.team-role { color: var(--secondary); font-weight: 700; font-size: .9rem; margin: 0 0 6px; }

.card-feature { text-align: center; }
.feature-icon { font-size: 2.2rem; display: block; margin-bottom: 10px; }

/* ---------- Contato / CTA ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; align-items: start; }
.map-wrap iframe { width: 100%; min-height: 300px; border: 0; border-radius: var(--radius); }
.cta-band { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; padding: 48px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cta-inner h2 { font-size: 1.5rem; margin: 0; }

/* ---------- Formulários ---------- */
.card-form { margin-bottom: 20px; }
.card-form h1, .card-form h2 { font-size: 1.3rem; margin-bottom: 4px; }
label { display: block; font-weight: 600; font-size: .92rem; margin: 14px 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date],
input[type=time], input[type=number], input[type=url], input[type=datetime-local],
select, textarea {
  width: 100%; padding: 11px 14px; font: inherit;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
input[type=color] { width: 64px; height: 40px; padding: 2px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; }
input[type=file] { font-size: .9rem; }
input:disabled { background: var(--bg); color: var(--muted); }
textarea { resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; }
.form-links { text-align: center; margin-top: 16px; font-size: .93rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Flash ---------- */
.flash { padding: 13px 18px; border-radius: 10px; margin: 16px 0; font-weight: 600; font-size: .95rem; }
.flash-ok { background: var(--ok-bg); color: var(--ok-ink); border: 1px solid #a7f3d0; }
.flash-erro { background: var(--err-bg); color: var(--err-ink); border: 1px solid #fecaca; }
.flash-info { background: var(--info-bg); color: var(--info-ink); border: 1px solid #bfdbfe; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; padding: 13px 16px; background: var(--bg); border-bottom: 2px solid var(--line); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.thumb { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: block; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge-pendente { background: #fef9c3; color: #a16207; }
.badge-confirmado { background: #dcfce7; color: #15803d; }
.badge-concluido { background: #e0f2fe; color: #0369a1; }
.badge-cancelado { background: #fee2e2; color: #b91c1c; }

/* ---------- Agendamento (slots) ---------- */
.slots { display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px; padding: 6px 0; }
.slot {
  border: 1.5px solid var(--line); background: #fff; border-radius: 10px;
  padding: 9px 16px; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink-soft);
}
.slot:hover { border-color: var(--primary); color: var(--primary); }
.slot.selected { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Página / admin ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.admin-split { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
.filters { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; margin-bottom: 20px; }
.filters label { margin: 0; }
.stats { margin-bottom: 32px; }
.stat { text-align: center; }
.stat-num { font-size: 2.1rem; font-weight: 800; color: var(--primary); display: block; }
.stat-label { color: var(--muted); font-size: .88rem; font-weight: 600; }
.pagination { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pagination a {
  display: inline-block; min-width: 38px; text-align: center; padding: 7px 10px;
  border: 1.5px solid var(--line); border-radius: 8px; text-decoration: none; font-weight: 700; color: var(--ink-soft);
}
.pagination a.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Estado vazio ---------- */
.empty-state { text-align: center; padding: 56px 20px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-icon { font-size: 2.6rem; display: block; margin-bottom: 8px; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #cbd5e1; margin-top: 64px; padding: 44px 0 0; font-size: .93rem; }
.footer a { color: #fff; }
.footer strong { color: #fff; }
.footer-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding-bottom: 26px; }
.footer-copy { border-top: 1px solid #1e293b; padding: 16px 20px; text-align: center; color: #94a3b8; font-size: .85rem; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .admin-split { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }

  /* Menu hambúrguer (CSS puro, sem JS) */
  .nav-burger { display: flex; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; }
  .nav-burger span { width: 24px; height: 3px; background: var(--ink); border-radius: 2px; transition: .2s; }
  .nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 16px 20px; gap: 12px;
    box-shadow: var(--shadow);
  }
  .nav a { padding: 6px 0; }
  .nav-toggle:checked ~ .nav { display: flex; }
}
