/* ============================================================
   THEME.CSS — camada de tema moderna do AGENDY
   • Carregado POR ÚLTIMO: só sobrescreve variáveis e refina componentes.
   • Para desligar: remover a linha <link ... theme.css> do index.html
     (ou abrir o site com ?classico=1).
   • Modo escuro: html[data-theme="dark"] — aplicado só nas áreas do cliente
     (home, perfil, agendamento, login, painel do cliente). Painéis do
     profissional e do admin permanecem claros (decidido em theme.js).
   ============================================================ */

@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

/* ── Tokens (modo claro) ───────────────────────────────────── */
:root {
  --font: 'Geist', 'Inter', system-ui, -apple-system, sans-serif;
  --gray-100: #F2F2F7;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05), 0 2px 10px rgba(0,0,0,.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 18px 44px rgba(0,0,0,.12);
  --shadow-xl: 0 30px 80px rgba(0,0,0,.22);
  --glass: rgba(255,255,255,.74);
  --glass-line: rgba(0,0,0,.07);
  --ease: cubic-bezier(.2,.8,.2,1);
}

body { letter-spacing: -.011em; }
h1, h2, h3, .h-hero-title, .h-section-title, .page-title, .login-brand { letter-spacing: -.035em; }

/* ── Botões: pílulas ───────────────────────────────────────── */
.btn { border-radius: var(--radius-full); font-weight: 600; letter-spacing: -.01em; transition: transform .18s var(--ease), background .18s, box-shadow .18s; }
.btn:active { transform: scale(.97); }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(0,0,0,.18); }

/* ── Cartões ───────────────────────────────────────────────── */
.card, .stat-card, .chart-card, .promo-card, .team-card, .service-item {
  border-radius: var(--radius-lg);
  border-color: var(--glass-line);
  box-shadow: var(--shadow-sm);
}

/* ── Campos de formulário ──────────────────────────────────── */
.form-input {
  border-radius: 14px;
  background: var(--gray-100);
  border-color: transparent;
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.form-input:focus { background: var(--white); border-color: var(--black); box-shadow: 0 0 0 4px rgba(0,0,0,.06); outline: none; }

/* ── Janelas (modais) em vidro ─────────────────────────────── */
.modal-overlay { backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); }
.modal { border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); }

/* ── Barras superiores em vidro ────────────────────────────── */
.topbar { background: var(--glass); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); border-bottom-color: var(--glass-line); }
.h-nav { background: var(--glass); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); border-bottom-color: var(--glass-line); }
.h-mobile-drawer { background: var(--white); }

/* ═══ CARDS DOS ESTABELECIMENTOS (home) ═════════════════════ */
.h-est-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow-sm);
  background: var(--white);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease);
}
.h-est-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.h-est-card:active { transform: translateY(-1px) scale(.995); }

.h-est-card-header { height: 176px; background: #1c1c1e; }
.h-est-card-header::after {                      /* degradê para dar profundidade à capa */
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.52) 0%, rgba(0,0,0,0) 62%);
}
.h-est-cover-img { transition: transform .5s var(--ease); }
.h-est-card:hover .h-est-cover-img { transform: scale(1.05); }
.h-est-cover-tag {                                /* selo da categoria em vidro */
  position: absolute; top: 14px; left: 14px; right: auto; bottom: auto; width: fit-content; z-index: 2;
  background: rgba(255,255,255,.2); color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  padding: 6px 12px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
}
.h-est-card-body { padding: 0 20px 20px; }
.h-est-card-top-row { display: flex; align-items: flex-end; gap: 14px; margin-top: -32px; position: relative; z-index: 3; }
.h-est-card-avatar {
  width: 66px; height: 66px; flex: 0 0 66px; border-radius: 21px; position: relative; overflow: hidden;
  border: 4px solid var(--white); background: #0a0a0b; color: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.22);
  display: grid; place-items: center;
}
.h-est-avatar-initial { font-size: 24px; font-weight: 700; }
.h-est-avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.h-est-card-top-info { min-width: 0; padding-bottom: 2px; }
.h-est-card-name { font-size: 18px; font-weight: 700; letter-spacing: -.025em; color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-est-card-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--gray-500); margin-top: 3px; }
.h-est-card-meta strong { color: var(--black); }
.h-est-card-meta svg[fill] { fill: currentColor; }       /* estrela monocromática */
.h-est-services { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; }
.h-est-svc-tag {
  background: var(--gray-100); color: var(--gray-600); border: 0;
  border-radius: 99px; padding: 5px 11px; font-size: 11.5px; font-weight: 500;
}
.h-est-from { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 2px 0; font-size: 12.5px; color: var(--gray-500); }
.h-est-from b { font-size: 18px; font-weight: 700; color: var(--black); letter-spacing: -.03em; }
.h-est-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.h-btn-ver, .h-est-card-actions .h-btn-book {
  height: 46px; border-radius: 99px; font-size: 14px; font-weight: 600; letter-spacing: -.01em;
  border: 0; display: grid; place-items: center; cursor: pointer; transition: transform .18s var(--ease), background .18s;
}
.h-btn-ver { background: var(--gray-100); color: var(--black); }
.h-btn-ver:hover { background: var(--gray-200); }
.h-est-card-actions .h-btn-book { background: var(--black); color: var(--white); }
.h-est-card-actions .h-btn-book:hover { transform: translateY(-1px); }
.h-est-grid { gap: 22px; }

/* ── Cards de categoria ────────────────────────────────────── */
.h-cat-card { border-radius: var(--radius-xl); border: 1px solid var(--glass-line); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .28s var(--ease), box-shadow .28s var(--ease); }
.h-cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.h-cat-card-info { background: var(--white); }

/* ── Botão de tema (claro/escuro) ──────────────────────────── */
#agendyThemeBtn {
  position: fixed; right: 16px; bottom: 16px; z-index: 900;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--glass-line);
  background: var(--glass); color: var(--black);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--shadow-md); cursor: pointer; display: grid; place-items: center;
  transition: transform .2s var(--ease), box-shadow .2s;
}
#agendyThemeBtn:hover { transform: scale(1.06); }
#agendyThemeBtn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
#agendyThemeBtn .sun { display: none; }
html[data-theme="dark"] #agendyThemeBtn .sun { display: block; }
html[data-theme="dark"] #agendyThemeBtn .moon { display: none; }
#agendyThemeBtn[hidden] { display: none; }
/* dentro do cabeçalho (home e painel do cliente) */
#agendyThemeBtn.inline { position: static; width: 38px; height: 38px; flex: 0 0 38px; box-shadow: none; background: transparent; margin-right: 8px; }
#agendyThemeBtn.inline:hover { background: var(--gray-100); }
.cp-header #agendyThemeBtn.inline { color: #fff; border-color: rgba(255,255,255,.22); }
.cp-header #agendyThemeBtn.inline:hover { background: rgba(255,255,255,.12); }

/* ═══ MODO ESCURO ═══════════════════════════════════════════ */
html[data-theme="dark"] {
  color-scheme: dark;
  --white:    #1C1C1E;
  --black:    #F5F5F7;
  --gray-50:  #141416;
  --gray-100: #000000;
  --gray-200: #2C2C2E;
  --gray-300: #3A3A3C;
  --gray-400: #8E8E93;
  --gray-500: #A1A1A6;
  --gray-600: #C7C7CC;
  --gray-700: #D1D1D6;
  --gray-800: #E5E5EA;
  --gray-900: #F5F5F7;
  --success-bg: #0F2A1A; --error-bg: #2A1214; --warning-bg: #2A1F0A; --info-bg: #0F1B33;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5), 0 2px 12px rgba(0,0,0,.35);
  --shadow-md: 0 8px 26px rgba(0,0,0,.5);
  --shadow-lg: 0 18px 48px rgba(0,0,0,.6);
  --shadow-xl: 0 30px 80px rgba(0,0,0,.7);
  --glass: rgba(28,28,30,.72);
  --glass-line: rgba(255,255,255,.1);
}
/* Blocos que são escuros nos dois modos: mantêm as cores originais */
html[data-theme="dark"] .h-hero,
html[data-theme="dark"] .h-footer,
html[data-theme="dark"] .cp-header,
html[data-theme="dark"] .h-est-card-header,
html[data-theme="dark"] .h-det-cover,
html[data-theme="dark"] .h-det-header,
html[data-theme="dark"] .login-pro-left,
html[data-theme="dark"] .h-section[style*="background:var(--black)"] {
  --white: #FFFFFF; --black: #09090B;
  --gray-50: #FAFAFA; --gray-100: #F4F4F5; --gray-200: #E4E4E7; --gray-300: #D4D4D8; --gray-400: #A1A1AA;
  --gray-500: #71717A; --gray-600: #52525B; --gray-700: #3F3F46; --gray-800: #27272A; --gray-900: #18181B;
}
/* Fundos escritos direto no CSS antigo */
html[data-theme="dark"] .h-det-topbar,
html[data-theme="dark"] .h-det-tabs-below,
html[data-theme="dark"] .h-acc-header,
html[data-theme="dark"] .h-det-topbar-back,
html[data-theme="dark"] .h-mobile-drawer { background: var(--white); }
html[data-theme="dark"] .h-det-cover-avatar { background: var(--white); color: var(--black); }
html[data-theme="dark"] .h-est-card-avatar { background: #F5F5F7; color: #09090B; border-color: var(--white); }
html[data-theme="dark"] .form-input:focus { box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
html[data-theme="dark"] .form-input { color: var(--black); background: var(--gray-200); }
html[data-theme="dark"] .form-input:focus { background: var(--gray-300); border-color: var(--black); }
html[data-theme="dark"] .h-est-svc-tag,
html[data-theme="dark"] .h-btn-ver { background: var(--gray-200); color: var(--gray-700); }
html[data-theme="dark"] .h-btn-ver { color: var(--black); }
html[data-theme="dark"] .h-btn-ver:hover { background: var(--gray-300); }
html[data-theme="dark"] #agendyThemeBtn.inline:hover { background: var(--gray-200); }
html[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,.6); }
html[data-theme="dark"] img { color-scheme: normal; }

/* ── Cabeçalho no celular: logo menor para não encostar nos botões ── */
.h-nav-hamburger { border-radius: 50%; background: transparent; border-color: var(--glass-line); }
html[data-theme="dark"] .h-nav-hamburger:hover { background: var(--gray-200); }
@media (max-width: 480px) {
  .h-nav-logo img { height: 23px !important; }
  #agendyThemeBtn.inline { width: 36px; height: 36px; flex-basis: 36px; margin-right: 6px; }
}

/* ── Capa do estabelecimento: degradê mais forte para o nome ficar legível ── */
.h-det-cover-gradient { background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.45) 45%, rgba(0,0,0,.05) 100%) !important; }
.h-det-cover-name { text-shadow: 0 2px 12px rgba(0,0,0,.45); letter-spacing: -.03em; }
.h-det-cover-avatar { border-radius: 18px; }

/* ── Etapas do agendamento: etapas concluídas legíveis no escuro ── */
.bk-steps { border-radius: 14px; }
html[data-theme="dark"] .bk-step-dot.done { background: var(--gray-200); color: var(--gray-500); }

/* ── Idiomas ── */
html.i18n-wait body { visibility: hidden; }
#agendyLangBtn[hidden] { display: none !important; }
#agendyLangBtn { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--bz-bd, rgba(128,128,128,.35)); background: var(--bz-soft, rgba(128,128,128,.12)); color: inherit; font: 700 12px/1 var(--font, system-ui); cursor: pointer; }
#agendyLangBtn:not(.inline) { position: fixed; left: 12px; bottom: 12px; z-index: 9000; background: var(--white, #fff); box-shadow: 0 2px 10px rgba(0,0,0,.18); }
#agendyLangBtn.inline { position: static; margin: 0 4px; }
#agendyLangMenu { position: fixed; z-index: 9500; width: 160px; padding: 6px; border-radius: 14px; background: var(--white, #fff); color: var(--black, #111); border: 1px solid rgba(128,128,128,.3); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
#agendyLangMenu[hidden] { display: none; }
#agendyLangMenu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 9px; background: none; color: inherit; font: 600 14px var(--font, system-ui); cursor: pointer; }
#agendyLangMenu button:hover, #agendyLangMenu button[aria-selected="true"] { background: rgba(128,128,128,.16); }
