/* =====================================================================
   style.css — App público de agendamento
   Dark mode + tipografia elegante (Fraunces + Inter + Space Mono)
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400..700&family=Inter:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

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

:root {
  --bg:           #161A18;
  --bg-card:      #1E2420;
  --bg-input:     #252B27;
  --border:       #2E3830;
  --accent:       #C8923A;
  --accent-soft:  #E7C98A;
  --accent-dim:   rgba(200, 146, 58, 0.12);
  --text:         #F0EAD6;
  --text-muted:   #8A9A90;
  --text-inv:     #161A18;
  --success:      #3E7A5C;
  --danger:       #A8503C;
  --radius:       14px;
  --radius-sm:    8px;
  --shadow:       0 4px 24px rgba(0, 0, 0, 0.5);
  --font-display: 'Fraunces', serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'Space Mono', monospace;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* =====================================================================  SHELL  ===================================================================== */

#app-publico, .app-publico {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.topo-app {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem 0.875rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topo-app .listra {
  display: inline-block;
  width: 5px;
  height: 28px;
  border-radius: 4px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 6px, var(--danger) 6px 12px, var(--text) 12px 18px);
  flex-shrink: 0;
}

.topo-app .marca {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.topo-app .filial-atual {
  font-size: 0.72rem;
  color: var(--accent-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.botao-voltar {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.botao-voltar:hover { background: var(--border); border-color: var(--accent); }

.conteudo-app {
  flex: 1;
  padding: 1.25rem 1.25rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* =====================================================================  ESTADOS  ===================================================================== */

.carregando { text-align: center; color: var(--text-muted); padding: 3rem 1rem; font-size: 0.9rem; }
.mensagem-vazia { text-align: center; color: var(--text-muted); font-size: 0.9rem; padding: 2.5rem 1rem; line-height: 1.6; }
.mensagem-erro {
  background: rgba(168, 80, 60, 0.15);
  border: 1px solid var(--danger);
  color: #E8896A;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.oculto { display: none !important; }
.silencioso { color: var(--text-muted); font-size: 0.86rem; }
.mt-1 { margin-top: 0.75rem; }
.mt-2 { margin-top: 1.5rem; }

/* =====================================================================  CARTÃO BASE  ===================================================================== */

.cartao-app {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
}
.cartao-app h3 { margin-bottom: 0.3rem; }
.endereco { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.2rem; }
.link-maps { color: var(--accent); font-size: 0.82rem; font-weight: 600; }
.link-maps:hover { text-decoration: underline; }
.link-maps::after { content: ' →'; }

/* =====================================================================  FILIAL  ===================================================================== */

.cartao-filial {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  width: 100%;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.cartao-filial:hover { border-color: var(--accent); }
.cartao-filial:active { transform: scale(0.99); }
.cartao-filial h3 { margin-bottom: 0.2rem; }

/* =====================================================================  MENU PRINCIPAL  ===================================================================== */

.menu-principal { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; }

.botao-menu-grande {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, background 0.15s;
}
.botao-menu-grande:hover { border-color: var(--accent); background: #222A24; }
.botao-menu-grande:active { transform: scale(0.99); }

.icone-circulo {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.botao-menu-grande .descricao { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; font-weight: 400; }

/* =====================================================================  WIZARD  ===================================================================== */

.passos-indicador { display: flex; gap: 6px; margin-bottom: 1.25rem; }
.passo { height: 4px; flex: 1; border-radius: 2px; background: var(--border); transition: background 0.25s; }
.passo.ativo     { background: var(--accent); }
.passo.concluido { background: var(--success); }

/* =====================================================================  OPÇÕES  ===================================================================== */

.lista-opcoes { display: flex; flex-direction: column; gap: 0.6rem; }

.opcao-selecionavel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
  transition: border-color 0.15s, background 0.15s;
}
.opcao-selecionavel:hover { border-color: var(--accent-soft); }
.opcao-selecionavel.selecionada { border-color: var(--accent); background: var(--accent-dim); }
.opcao-selecionavel .titulo { font-size: 0.95rem; font-weight: 600; display: block; }
.opcao-selecionavel .subtitulo { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }
.opcao-selecionavel .preco { font-family: var(--font-mono); font-size: 0.88rem; font-weight: 700; color: var(--accent); white-space: nowrap; flex-shrink: 0; }

.avatar-barbeiro {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent-soft);
  font-family: var(--font-display);
  font-size: 0.9rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.avatar-barbeiro img { width: 100%; height: 100%; object-fit: cover; }

/* =====================================================================  DATA  ===================================================================== */

.dias-scroll {
  display: flex; gap: 0.5rem;
  overflow-x: auto; padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dias-scroll::-webkit-scrollbar { display: none; }

.chip-dia {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  min-width: 56px;
  padding: 0.6rem 0.5rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; flex-shrink: 0;
  transition: border-color 0.15s;
}
.chip-dia:hover { border-color: var(--accent-soft); }
.chip-dia.ativo { border-color: var(--accent); background: var(--accent-dim); }
.chip-dia .dia-semana { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.chip-dia.ativo .dia-semana { color: var(--accent-soft); }
.chip-dia .dia-numero { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--text); }

/* =====================================================================  HORÁRIOS  ===================================================================== */

.grade-horarios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; margin-top: 1rem; }

.slot-horario {
  font-family: var(--font-mono);
  font-size: 0.88rem; font-weight: 700;
  text-align: center;
  padding: 0.65rem 0.5rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.slot-horario:hover { border-color: var(--accent-soft); }
.slot-horario.selecionado { border-color: var(--accent); background: var(--accent); color: var(--text-inv); }
.slot-horario[disabled] { opacity: 0.3; cursor: not-allowed; text-decoration: line-through; }

/* =====================================================================  FORMULÁRIOS  ===================================================================== */

.campo-app { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.9rem; }
.campo-app label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.campo-app input,
.campo-app select,
.campo-app textarea {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none; appearance: none;
}
.campo-app input:focus,
.campo-app select:focus,
.campo-app textarea:focus { border-color: var(--accent); }
.campo-telefone { display: grid; grid-template-columns: 140px 1fr; gap: 0.5rem; }

/* =====================================================================  RESUMO  ===================================================================== */

.resumo-linha {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.resumo-linha:last-child { border-bottom: none; }
.resumo-linha .rotulo { color: var(--text-muted); font-size: 0.82rem; }
.resumo-linha .valor  { font-weight: 600; text-align: right; }

/* =====================================================================  SUCESSO  ===================================================================== */

.tela-sucesso { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2.5rem 1rem; gap: 0.5rem; }
.icone-sucesso {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(62, 122, 92, 0.15);
  border: 2px solid var(--success);
  color: #5BB585;
  font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.tela-sucesso h2 { font-size: 1.4rem; }
.tela-sucesso p  { color: var(--text-muted); font-size: 0.9rem; }
.tela-sucesso .mt-2 { margin-top: 1.5rem; width: 100%; }

/* =====================================================================  BOTÕES  ===================================================================== */

.botao-app {
  display: block; width: 100%;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem; font-weight: 700;
  cursor: pointer; border: none;
  text-align: center; text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
}
.botao-app:active { transform: scale(0.98); }
.botao-app:disabled, .botao-app[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; }

.botao-app-acento    { background: var(--accent); color: var(--text-inv); }
.botao-app-primario  { background: var(--text); color: var(--text-inv); }
.botao-app-acento:hover:not(:disabled),
.botao-app-primario:hover:not(:disabled) { opacity: 0.88; }

.botao-app-secundario { background: var(--bg-card); color: var(--text); border: 1.5px solid var(--border); }
.botao-app-secundario:hover { border-color: var(--accent); }

.barra-acao-fixa {
  position: fixed; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  padding: 1rem 1.25rem 1.5rem;
  background: linear-gradient(to top, var(--bg) 65%, transparent);
  z-index: 20;
}

/* =====================================================================  LOJA  ===================================================================== */

.grade-produtos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }

.cartao-produto {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 0.35rem;
}
.cartao-produto h3 { font-size: 0.92rem; line-height: 1.3; margin-bottom: 0.1rem; }
.cartao-produto .descricao { font-size: 0.76rem; color: var(--text-muted); line-height: 1.4; min-height: 2.2em; }
.cartao-produto .preco { font-family: var(--font-mono); font-size: 0.95rem; font-weight: 700; color: var(--accent); margin-top: auto; padding-top: 0.4rem; }
.cartao-produto .indisponivel { font-size: 0.72rem; font-weight: 700; color: var(--danger); text-transform: uppercase; letter-spacing: 0.04em; }

.recibo-termico {
  max-width: 80mm;
  margin: 0 auto;
  padding: 4mm 3mm;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11pt;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.recibo-termico .recibo-linha {
  display: flex;
  justify-content: space-between;
  padding: 0.5mm 0;
}
.recibo-termico .recibo-total {
  font-weight: bold;
  border-top: 2px dashed #000;
  padding-top: 1mm;
  margin-top: 1mm;
}
.recibo-termico .recibo-agradecimento {
  text-align: center;
  margin-top: 2mm;
  border-top: 1px dashed #888;
  padding-top: 2mm;
}
.recibo-termico hr {
  border: none;
  border-top: 1px dashed #888;
  margin: 1mm 0;
}