/* ================================================================
   DroneDocs — Tema base (dark + dourado). Mobile-first (base 380px).
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Inter+Tight:wght@400;500;600&family=JetBrains+Mono:wght@500;600;700&display=swap');

:root {
  /* superfícies (preto + dourado ProdTech) */
  --bg-0:        #0a0a0b;
  --bg-1:        #0f0f12;
  --panel:       #151517;
  --panel-2:     #1b1b1f;
  --line:        #26262c;
  --line-soft:   #1e1e23;

  /* texto */
  --txt:         #f3efe6;
  --txt-mut:     #a7a29a;
  --txt-dim:     #726d64;

  /* marca */
  --gold:        #D4AF37;
  --gold-2:      #c19a2e;
  --gold-soft:   #e7cd76;
  --gold-ink:    #1a1405;

  /* status */
  --ok:          #34d399;   /* vigente  */
  --warn:        #f5b544;   /* vencendo */
  --danger:      #f26d6d;   /* vencido  */
  --muted:       #7c8aa3;   /* análise  */

  /* tinta de fundo dos selos (com alpha) */
  --ok-bg:       rgba(52,211,153,.14);
  --warn-bg:     rgba(245,181,68,.16);
  --danger-bg:   rgba(242,109,109,.15);
  --muted-bg:    rgba(124,138,163,.16);

  --radius:      16px;
  --radius-sm:   11px;
  --shadow:      0 14px 40px rgba(0,0,0,.35);
  --font-disp:   'Bricolage Grotesque', system-ui, sans-serif;
  --font-body:   'Inter Tight', system-ui, -apple-system, sans-serif;
  --font-mono:   'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --wrap:        460px;      /* largura máx. do app mobile-first */
  --nav-h:       64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--txt);
  background:
    radial-gradient(1100px 560px at 50% -12%, rgba(212,175,55,.07) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  background-attachment: fixed;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-disp); font-weight: 700; letter-spacing: -.02em; margin: 0 0 .4em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
a { color: var(--gold); text-decoration: none; }
small { color: var(--txt-mut); }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.app-main { padding-top: 18px; padding-bottom: calc(var(--nav-h) + 58px + env(safe-area-inset-bottom)); }
.stack > * + * { margin-top: 14px; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-disp); font-weight: 700; font-size: 1.15rem; color: var(--txt); }
.brand .b-mark { color: var(--gold); }
.brand .b-id   { color: var(--gold); }

/* ---------- Cartão ---------- */
.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card-tit { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-tit h2, .card-tit h3 { margin: 0; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: 13px 18px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; width: 100%; transition: transform .12s ease, filter .12s ease, background .12s;
}
.btn:active { transform: translateY(1px); }
.btn-gold  { background: linear-gradient(180deg, var(--gold) 0%, var(--gold-2) 100%); color: var(--gold-ink); }
.btn-gold:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--txt); border-color: var(--line); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-sm { width: auto; padding: 9px 14px; font-size: .85rem; }

/* ---------- Selos de status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok     { color: var(--ok);     background: var(--ok-bg);     border-color: rgba(52,211,153,.30); }
.badge.warn   { color: var(--warn);   background: var(--warn-bg);   border-color: rgba(245,181,68,.32); }
.badge.danger { color: var(--danger); background: var(--danger-bg); border-color: rgba(242,109,109,.32); }
.badge.muted  { color: var(--muted);  background: var(--muted-bg);  border-color: rgba(124,138,163,.30); }

/* ---------- Contadores (painel) ---------- */
.counters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.counter { text-align: center; padding: 6px 2px; }
.counter b { font-family: var(--font-disp); font-size: 1.7rem; display: block; line-height: 1; margin-bottom: 6px; }
.counter span { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--txt-dim); }
.counter.ok b     { color: var(--ok); }
.counter.warn b   { color: var(--warn); }
.counter.danger b { color: var(--danger); }
.counter.muted b  { color: var(--muted); }

/* ---------- Item de documento ---------- */
.doc { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.doc:last-child { border-bottom: 0; }
.doc-ic { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 1.1rem; }
.doc-main { flex: 1; min-width: 0; }
.doc-main .t { font-weight: 600; font-size: .93rem; }
.doc-main .s { font-size: .78rem; color: var(--txt-mut); }

/* ---------- Campos ---------- */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .82rem; color: var(--txt-mut); margin-bottom: 6px; }
input, select {
  width: 100%; padding: 13px 14px; font: inherit; color: var(--txt);
  background: var(--bg-0); border: 1px solid var(--line); border-radius: 12px; outline: none;
}
input:focus, select:focus { border-color: var(--gold); }

/* ---------- Barra de navegação inferior ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: var(--wrap);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box;
  background: rgba(10,10,11,.94); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0;
  display: flex; z-index: 40;
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--txt-dim); font-size: .66rem; }
.tabbar a.active { color: var(--gold); }
.tabbar .ic { font-size: 1.15rem; }

/* ---------- Barra de progresso ---------- */
.progress { height: 8px; background: var(--bg-0); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }

/* ---------- Topo ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; }

/* ---------- Utilidades ---------- */
.muted-txt { color: var(--txt-mut); }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.divider { height: 1px; background: var(--line-soft); margin: 14px 0; border: 0; }
.pill-plan { font-size: .72rem; font-weight: 600; color: var(--gold); background: rgba(212,175,55,.12); border: 1px solid rgba(212,175,55,.3); padding: 4px 10px; border-radius: 999px; }

/* ---------- Onboarding (login / cadastro / completar / pagamento) ---------- */
.auth-wrap{min-height:100dvh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:28px 20px;}
.auth-card{width:100%; max-width:440px;}
.auth-head{text-align:center; margin-bottom:24px;}
.auth-brand{display:inline-flex; align-items:center; gap:10px; font-family:var(--font-disp); font-weight:800; font-size:1.7rem; letter-spacing:-.03em;}
.auth-brand .id{color:var(--gold);}
.auth-brand .mk{width:34px;height:34px;display:grid;place-items:center;border:1.5px solid var(--gold);border-radius:10px;color:var(--gold);}
.auth-brand .mk svg{width:20px;height:20px;}
.auth-title{font-family:var(--font-disp);font-weight:800;font-size:1.7rem;margin:14px 0 4px;}
.auth-sub{color:var(--txt-mut); font-size:.95rem;}
.card-auth{background:linear-gradient(180deg,var(--panel),var(--panel-2)); border:1px solid var(--line); border-radius:18px; padding:24px; box-shadow:var(--shadow);}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:12px;}
#erro{display:none; background:rgba(232,105,95,.12); border:1px solid rgba(232,105,95,.4); color:#f4a29b; font-size:.88rem; padding:10px 12px; border-radius:10px; margin-bottom:14px;}
.gbtn{display:flex; align-items:center; justify-content:center; gap:10px; width:100%; padding:13px; border-radius:12px; border:1px solid var(--line); background:#fff; color:#1a1a1a; font:inherit; font-weight:600; cursor:pointer;}
.gbtn:hover{filter:brightness(.97);}
.sep{display:flex; align-items:center; gap:12px; color:var(--txt-dim); font-size:.8rem; margin:16px 0;}
.sep::before,.sep::after{content:""; flex:1; height:1px; background:var(--line-soft);}
.link{background:none; border:0; color:var(--gold-soft); font:inherit; cursor:pointer; padding:0; text-decoration:none;}
.terms{display:flex; align-items:flex-start; gap:10px; font-size:.86rem; color:var(--txt-mut); margin:6px 0 16px; cursor:pointer;}
.terms input{width:18px; height:18px; margin-top:2px; accent-color:var(--gold);}
.legal{text-align:center; color:var(--txt-dim); font-size:.78rem; margin-top:16px;}
.legal a{color:var(--txt-mut);}
.hint{font-size:.8rem; color:var(--txt-dim); margin-top:6px;}

/* ---------- Ícones SVG (substituem emojis) ---------- */
.tabbar .ic{display:grid; place-items:center;}
.tabbar .ic svg{width:23px; height:23px;}
.brand .b-mark{display:grid; place-items:center; width:30px; height:30px; border:1.5px solid var(--gold); border-radius:9px;}
.brand .b-mark svg{width:18px; height:18px; color:var(--gold);}
.ck{display:inline-grid; place-items:center; width:22px; height:22px; border-radius:6px; flex:0 0 auto;}
.ck.done{background:var(--ok); color:#07120c;}
.ck.todo{border:1.5px solid var(--line); color:transparent;}
.ck svg{width:14px; height:14px;}

/* ---------- Painel estilo DronePass ---------- */
.sec-label{font-family:var(--font-mono);font-size:.68rem;font-weight:600;letter-spacing:.22em;text-transform:uppercase;color:var(--gold);margin-bottom:8px;display:block;}
.hello{font-family:var(--font-disp);font-weight:800;font-size:1.72rem;margin:0 0 14px;padding-bottom:14px;position:relative;}
.hello::after{content:"";position:absolute;left:0;bottom:0;width:100%;height:1px;background:linear-gradient(90deg,rgba(224,185,60,.55),rgba(224,185,60,.05));}
.profile-card{display:grid;grid-template-columns:auto 1fr;column-gap:13px;row-gap:9px;align-items:center;background:linear-gradient(160deg,var(--panel),var(--panel-2));border:1px solid var(--line);border-radius:16px;padding:14px 15px;box-shadow:var(--shadow);}
.profile-card .pf-photo{grid-row:2;grid-column:1;}
.profile-card > div{grid-row:2;grid-column:2;min-width:0;}
.profile-card .pf-badge{grid-row:1;grid-column:1 / -1;}
.pf-photo{width:50px;height:50px;flex:0 0 50px;border-radius:12px;overflow:hidden;border:2px solid var(--gold);background:#222;}
.pf-photo img{width:100%;height:100%;object-fit:cover;display:block;}
.pf-name{font-family:var(--font-disp);font-weight:700;font-size:1.04rem;line-height:1.15;}
.pf-mat{color:var(--txt-mut);font-size:.76rem;margin-top:1px;}
.pf-badge{margin-left:auto;font-family:var(--font-mono);font-size:.6rem;font-weight:700;color:var(--gold);background:rgba(212,175,55,.12);border:1px solid rgba(212,175,55,.3);padding:4px 10px;border-radius:999px;letter-spacing:.1em;white-space:nowrap;text-transform:uppercase;}
.op-pill{display:inline-flex;align-items:center;gap:6px;font-family:var(--font-mono);font-size:.6rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--ok);background:rgba(52,211,153,.14);border:1px solid rgba(52,211,153,.32);padding:5px 11px;border-radius:999px;}
.op-pill::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;}
.cred-item{display:flex;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid var(--line-soft);}
.cred-item:last-child{border-bottom:0;}
.cred-item .ci{width:24px;height:24px;flex:0 0 24px;border-radius:7px;border:1.5px solid var(--line);display:grid;place-items:center;color:transparent;}
.cred-item.done .ci{background:var(--ok);border-color:var(--ok);color:#07120c;}
.cred-item.done .ci svg{width:14px;height:14px;}
.cred-item .cl{font-size:.95rem;}
.cred-item.done .cl{color:var(--txt-dim);text-decoration:line-through;}
.cred-item .go{margin-left:auto;}
.cred-item.done .go{display:none;}
/* tabbar com FAB central */
.tabbar{overflow:visible;}
.tabbar .fab{position:absolute;left:50%;top:-20px;transform:translateX(-50%);width:54px;height:54px;border-radius:50%;background:linear-gradient(180deg,var(--gold-soft),var(--gold));color:var(--gold-ink);display:grid;place-items:center;box-shadow:0 8px 24px rgba(212,175,55,.35);border:0;cursor:pointer;font-size:.54rem;font-weight:700;}
.tabbar .fab svg{width:24px;height:24px;}

/* ============ PORTAL DESKTOP (menu no topo) ============ */
@media (min-width:1000px){
  /* menu horizontal fixo no topo */
  .tabbar{
    left:0; top:0; right:0; bottom:auto; transform:none; width:100%; max-width:none; height:66px;
    flex-direction:row; align-items:center; justify-content:flex-start; gap:4px;
    padding:0 70px 0 196px; border:0; border-bottom:1px solid var(--line); border-radius:0;
    background:rgba(10,10,11,.95); backdrop-filter:blur(10px); z-index:45; box-sizing:border-box;
  }
  .tabbar a{ flex:0 0 auto; flex-direction:row; align-items:center; gap:9px; padding:9px 16px; border-radius:10px; font-size:.92rem; color:var(--txt-mut); }
  .tabbar a:hover{ color:var(--txt); }
  .tabbar a.active{ background:rgba(212,175,55,.1); color:var(--gold); }
  .tabbar .fab.active{ background:rgba(212,175,55,.1); color:var(--gold); }
  .tabbar a .ic svg{ width:19px; height:19px; }
  .tabbar .fab{ position:static; transform:none; width:auto; height:auto; border-radius:10px; display:flex; flex-direction:row; align-items:center; gap:9px; padding:9px 16px; box-shadow:none; font-size:.92rem; font-weight:500; background:none; border:0; color:var(--txt-mut); }
  .tabbar .fab:hover{ color:var(--txt); }
  .tabbar .fab::after{ content:"Carteira"; }
  .tabbar .fab svg{ width:19px; height:19px; }
  /* logo (esq) + sair (dir) sobre a barra */
  .topbar{ position:fixed; top:0; left:0; right:0; max-width:none; z-index:46; margin:0; height:66px; padding:0 26px; display:flex; align-items:center; justify-content:space-between; background:transparent; pointer-events:none; }
  .topbar > *{ pointer-events:auto; }
  /* conteúdo centralizado abaixo do topo */
  .app-main{ margin:0 auto; max-width:1180px; padding:90px 32px 56px; }
  .app-main.stack{ max-width:880px; }
  .cart-wrap{ max-width:1120px; }
  .app-main.pg2{ max-width:1120px; display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:start; }
  .app-main.pg2 > *{ margin-top:0 !important; }
  .app-main.pg2 > div:first-child, .app-main.pg2 > .profile-card, .app-main.pg2 > .btn, .app-main.pg2 > #pwa-install, .app-main.pg2 > #cred-card, .app-main.pg2 > .pg-full{ grid-column:1 / -1; }
  /* títulos de seção maiores no desktop */
  .sec-label{ font-size:.82rem; letter-spacing:.2em; }
  .grp-tit{ font-size:.82rem !important; letter-spacing:.16em; }
}
