/* ===== DSF Informática — app do cliente =====
   2.6.2 — Loki - Lamentis
   Um só lugar para as cores: trocar o tema é trocar estas variáveis.
   • escuro (padrão)  • claro (para ler no sol)  • automático (segue o celular) */

:root {
  --bg: #060a14;
  --bg-2: #0a1222;
  --surface: #0d1729;
  --surface-2: #122036;
  --line: #1e2f4d;
  --line-forte: #2a4066;
  --text: #eef3ff;
  --muted: #a2b4d6;
  --primary: #e11d48;
  --primary-2: #6fd3e8;
  --whats: #25d366;
  --ok: #34d399;
  --warn: #f0b429;
  --campo: #0a1424;
  --cabecalho: rgba(6, 10, 20, .9);
  --sombra: 0 12px 30px rgba(0, 0, 0, .45);
  --radius: 12px;
  --zap-fundo: rgba(37, 211, 102, .15);
  --zap-borda: rgba(37, 211, 102, .55);
  --tema-fundo: rgba(111, 211, 232, .10);
  --tema-borda: rgba(111, 211, 232, .45);
}

/* ---------- TEMA CLARO: para ler no sol ---------- */
html[data-tema="claro"] {
  --bg: #f2f5fa;
  --bg-2: #e9eef7;
  --surface: #ffffff;
  --surface-2: #eef2f9;
  --line: #d3dceb;
  --line-forte: #b9c7dd;
  --text: #111f38;
  --muted: #4f5f7a;
  --primary: #d81b45;
  --primary-2: #0d7490;
  --whats: #128c4a;
  --ok: #0b7a53;
  --warn: #8a5c00;
  --campo: #ffffff;
  --cabecalho: rgba(255, 255, 255, .95);
  --sombra: 0 6px 18px rgba(20, 40, 80, .08);
  --zap-fundo: rgba(37, 211, 102, .12);
  --zap-borda: rgba(18, 140, 74, .55);
  --tema-fundo: rgba(13, 116, 144, .10);
  --tema-borda: rgba(13, 116, 144, .45);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(700px 420px at 85% -5%, rgba(225, 29, 72, .18), transparent 60%),
    radial-gradient(600px 380px at 5% 105%, rgba(111, 211, 232, .14), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  transition: background-color .18s ease, color .18s ease;
}
html[data-tema="claro"] body {
  background:
    radial-gradient(700px 420px at 85% -5%, rgba(216, 27, 69, .06), transparent 60%),
    radial-gradient(600px 380px at 5% 105%, rgba(13, 116, 144, .07), transparent 60%),
    var(--bg);
}

.container {
  width: 100%; max-width: 620px; margin: 0 auto;
  padding-left: calc(clamp(12px, 4vw, 16px) + env(safe-area-inset-left, 0px));
  padding-right: calc(clamp(12px, 4vw, 16px) + env(safe-area-inset-right, 0px));
}
a { color: var(--primary-2); }

/* ---------------- Cabeçalho ---------------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--cabecalho);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.app-header .inner {
  display: flex; align-items: center; gap: 9px; max-width: 620px; margin: 0 auto;
  padding: 10px 14px;
  padding-left: calc(14px + env(safe-area-inset-left, 0px));
  padding-right: calc(14px + env(safe-area-inset-right, 0px));
}
.app-header img { height: 28px; width: auto; }
.app-header .logo-claro { display: none; }
html[data-tema="claro"] .app-header .logo-escuro { display: none; }
html[data-tema="claro"] .app-header .logo-claro { display: block; }
.app-header .titles { line-height: 1.1; min-width: 0; }
.app-header .titles b { display: block; font-size: 14.5px; letter-spacing: .4px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.app-header .titles span { font-size: 10px; color: var(--muted); letter-spacing: 1.2px; text-transform: uppercase; }

.acoes-topo { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.botao-tema, .botao-zap {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--tema-borda);
  background: var(--tema-fundo); display: flex; align-items: center; justify-content: center;
  font-size: 15px; cursor: pointer; padding: 0; line-height: 1;
}
.botao-zap { background: var(--zap-fundo); border-color: var(--zap-borda); }
.botao-zap svg { width: 18px; height: 18px; fill: var(--whats); }
.app-ver {
  font-size: 10px; font-weight: 700; color: var(--primary-2);
  border: 1px solid var(--tema-borda); background: var(--tema-fundo);
  padding: 3px 7px; border-radius: 999px; white-space: nowrap;
}

/* ---------------- Cartões ---------------- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--sombra);
  padding: 13px;
  margin: 11px 0;
}
html[data-tema="claro"] .card { background: var(--surface); }
h1 { font-size: 17px; margin: 4px 0; }
h2 { font-size: 14.5px; margin: 0 0 2px; }
p.sub { color: var(--muted); font-size: 11px; margin: 2px 0 8px; line-height: 1.35; }
hr.linha { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

/* ---------------- Formulário (campos compactos) ---------------- */
label { display: block; font-size: 10px; color: var(--muted); margin: 7px 0 3px; font-weight: 600; }
label .req { color: var(--primary); }
input, select, textarea {
  width: 100%; padding: 7px 10px; border-radius: 8px;
  background: var(--campo); color: var(--text);
  border: 1px solid var(--line); font-size: 13px; font-family: inherit;
}
textarea { resize: vertical; min-height: 48px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(111, 211, 232, .16);
}
.note { font-size: 9.5px; color: var(--muted); margin-top: 5px; line-height: 1.35; }
/* iPhone: abaixo de 16px o Safari dá zoom ao tocar no campo. Só nele, aumentamos. */
@supports (-webkit-touch-callout: none) {
  input, select, textarea { font-size: 16px; }
}

/* ---------------- Botões ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 9px; border: 1px solid transparent;
  font-weight: 700; font-size: 12.5px; cursor: pointer; text-decoration: none; width: 100%;
  font-family: inherit;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), #7a1029); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line-forte); color: var(--text); }
.btn-ok { background: linear-gradient(135deg, #16a34a, #065f46); color: #fff; }
.btn-no { background: linear-gradient(135deg, #b91c1c, #7f1d1d); color: #fff; }
.btn-whats { background: var(--whats); color: #fff; }
html[data-tema="claro"] .btn-whats { color: #fff; }
.btn-row { display: flex; gap: 8px; margin-top: 8px; }
.btn-mini { width: auto; padding: 6px 11px; font-size: 11px; border-radius: 8px; }

/* ---------------- Bloco de login / "Você está dentro" ---------------- */
.login-bloco {
  background: var(--campo); border: 1px solid var(--tema-borda);
  border-radius: 9px; padding: 9px;
}
.login-topo { display: flex; align-items: center; gap: 7px; }
.login-topo b { font-size: 12px; }
.cadeado {
  width: 18px; height: 18px; border-radius: 6px; flex: 0 0 18px;
  background: var(--tema-fundo); border: 1px solid var(--tema-borda);
  display: flex; align-items: center; justify-content: center; font-size: 9px;
}
.login-linha { display: flex; gap: 7px; }
.login-linha .btn { width: auto; flex: 0 0 36%; padding: 8px; font-size: 12px; }

/* separador "ou" */
.ou { display: flex; align-items: center; gap: 9px; margin: 9px 0 2px;
  color: var(--muted); font-size: 9.5px; }
.ou::before, .ou::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* ---------------- Lista de chamados ---------------- */
.list-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px;
  background: var(--campo); cursor: pointer;
}
html[data-tema="claro"] .list-item { background: #fff; }
.list-item .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.list-item .proto { font-weight: 800; letter-spacing: .4px; font-size: 12.5px; }
.list-item .meta { font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.pill { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.big-proto { font-size: 20px; font-weight: 800; letter-spacing: .8px; color: var(--primary-2); }

/* ---------------- Acompanhamento (linha do tempo) ---------------- */
.steps { display: flex; flex-direction: column; gap: 0; margin: 8px 0 4px; }
.step { display: flex; gap: 10px; align-items: flex-start; }
.step .dot {
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 20px; margin-top: 1px;
  border: 2px solid var(--line); background: var(--campo);
  display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--muted);
}
.step .line { width: 2px; background: var(--line); flex: 1; min-height: 14px; margin-left: 9px; }
.step .body { padding-bottom: 8px; }
.step .body b { font-size: 12px; }
.step .body p { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.step.done .dot { background: var(--ok); border-color: var(--ok); color: #04241a; }
.step.current .dot { background: var(--primary-2); border-color: var(--primary-2); color: #fff; }
.step.alert .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.done .line, .step.current .line { background: var(--primary-2); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(111, 211, 232, .5); }
  50% { box-shadow: 0 0 0 6px rgba(111, 211, 232, 0); } }
.step.current .dot, .step.alert .dot { animation: pulse 1.6s infinite; }

/* ---------------- Avisos / mensagens ---------------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 50;
  background: var(--surface); border: 1px solid var(--primary-2); color: var(--text);
  padding: 10px 14px; border-radius: 10px; box-shadow: var(--sombra);
  max-width: 90%; font-size: 12.5px; display: none;
}
.toast.show { display: block; }
.toast.err { border-color: var(--primary); }
.toast.ok { border-color: var(--ok); }

/* ---------------- Janela de dados do cliente ---------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(3, 6, 12, .78); backdrop-filter: blur(4px);
  z-index: 100; display: grid; place-items: center; padding: 16px;
}
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; width: 100%; max-width: 440px; box-shadow: var(--sombra);
  max-height: 92vh; overflow: auto; color: var(--text);
}
.modal h2 { margin: 0 0 4px; }

.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 11px; }

/* ---------------- Barra "instalar / atualizar" ---------------- */
.install-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  max-width: 620px; margin: 10px auto 0; padding: 9px 12px;
  background: linear-gradient(135deg, rgba(225, 29, 72, .18), rgba(111, 211, 232, .14));
  border: 1px solid var(--tema-borda); border-radius: 10px;
  color: var(--text); font-size: 11.5px; line-height: 1.35;
  margin-left: calc(12px + env(safe-area-inset-left, 0px));
  margin-right: calc(12px + env(safe-area-inset-right, 0px));
}
html[data-tema="claro"] .install-bar { background: #fff; border-color: var(--line-forte); }
.install-bar[hidden] { display: none; }
.install-bar .btn { padding: 7px 12px; font-size: 11.5px; white-space: nowrap; width: auto; }
.install-acoes { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.instalar-atualizar { border-color: rgba(240, 180, 41, .6); }
@media (max-width: 430px) {
  .install-bar { flex-direction: column; align-items: stretch; text-align: center; }
  .install-acoes { justify-content: center; flex-wrap: wrap; }
}

/* ---------------- Rodapé ---------------- */
.app-rodape {
  text-align: center; font-size: 10px; color: var(--muted); opacity: .85;
  margin: 10px 16px 6px;
}

/* ---------------- Adapta a qualquer tela ---------------- */
.card, .list-item, .step .body, p, td, th, .big-proto { overflow-wrap: anywhere; }
img, svg { max-width: 100%; }

@media (max-width: 360px) {
  .btn-row { flex-wrap: wrap; }
  .app-header .titles span { letter-spacing: .8px; }
  .app-header img { height: 24px; }
  .big-proto { font-size: 18px; }
}

@media (min-width: 760px) {
  .container, .app-header .inner { max-width: 720px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .app-header .inner { padding-top: 6px; padding-bottom: 6px; }
  .app-header img { height: 22px; }
  .app-header .titles span { display: none; }
  .card { margin: 8px 0; }
  .toast { bottom: 12px; }
}


/* ---- Checkout de pagamento (adaptado do app Barbearia, 08/11/2026) ---- */
.dsf-pag-mask{position:fixed;inset:0;z-index:9999;background:rgba(3,7,15,.82);
  display:flex;align-items:center;justify-content:center;padding:16px;overflow:auto}
.dsf-pag-box{background:#0d1626;border:1px solid rgba(120,160,220,.28);border-radius:16px;
  padding:22px;width:100%;max-width:430px;color:#e8eef9;box-shadow:0 24px 60px rgba(0,0,0,.6)}
.dsf-pag-box h3{margin:0 0 4px;font-size:20px}
.dsf-pag-sub{margin:0 0 10px;font-size:13px;color:#9db0d4}
.dsf-pag-valor{font-size:30px;font-weight:800;color:#34d399;margin:6px 0 16px}
.dsf-pag-botoes{display:flex;flex-direction:column;gap:8px;margin-bottom:14px}
.dsf-pag-area{margin-top:6px}
.dsf-pag-area label{display:block;font-size:12px;color:#9db0d4;margin:10px 0 4px}
.dsf-pag-qr{display:flex;justify-content:center;background:#fff;border-radius:10px;padding:10px;margin:6px 0}
.dsf-pag-qr svg{width:190px;height:190px;max-width:100%}
.dsf-pag-copia{background:#060a14;border:1px solid rgba(120,160,220,.25);border-radius:8px;
  padding:10px;font-size:11px;word-break:break-all;max-height:90px;overflow:auto;color:#c8d6ee}
.dsf-pag-acoes{display:flex;justify-content:flex-end;margin-top:14px}
