/* ===== Utmify PWA — Design tokens extraídos do app (v2.3.21) ===== */
@font-face {
  font-family: 'Uber Move';
  src: url('assets/fonts/UberMoveTextLight.otf') format('opentype');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Uber Move';
  src: url('assets/fonts/UberMoveTextRegular.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Uber Move';
  src: url('assets/fonts/UberMoveTextMedium.otf') format('opentype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Uber Move';
  src: url('assets/fonts/UberMoveTextBold.otf') format('opentype');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  /* Marca */
  --navy:        #000243;   /* corpo do ícone */
  --navy-2:      #060a2e;
  --cyan:        #02d1f9;   /* topo do canto dobrado */
  --blue:        #0a84ff;
  --accent-grad: linear-gradient(135deg, #02d1f9 0%, #0a84ff 100%);

  /* Superfícies (dark) */
  --bg:          #05061a;
  --bg-2:        #080a22;
  --surface:     #10132b;
  --surface-2:   #161a38;
  --surface-3:   #1e2444;
  --border:      #232a4d;
  --border-soft: #1a2040;

  /* Texto */
  --text:        #f4f6ff;
  --text-2:      #a7adc9;
  --text-3:      #6b7196;

  /* Semânticas (verde=bom / vermelho=alerta, como no app) */
  --green:       #2ed573;
  --green-dim:   #17351f;
  --red:         #ff4d5e;
  --amber:       #ffb020;

  --radius:      18px;
  --radius-sm:   12px;
  --shadow:      0 12px 40px rgba(0,0,0,.45);
  --field-green: #3a7d1e;
}

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

html, body {
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(10,132,255,.10), transparent 60%),
    radial-gradient(900px 500px at 120% 10%, rgba(2,209,249,.07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: 'Uber Move', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

body { padding-bottom: env(safe-area-inset-bottom); }

.wrap {
  max-width: 460px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ===== Header ===== */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 4px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img.mark { width: 34px; height: 34px; border-radius: 9px; }
.brand .wordmark { height: 22px; }
.tag-pwa {
  font-size: 11px; font-weight: 600; letter-spacing: .12em;
  color: var(--cyan); border: 1px solid rgba(2,209,249,.35);
  padding: 4px 9px; border-radius: 999px; background: rgba(2,209,249,.08);
}

/* ===== Cards ===== */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.card h2 svg { width: 15px; height: 15px; }

/* ===== Status de permissão ===== */
.perm-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.perm-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 4px rgba(255,255,255,.04); }
.perm-dot.granted { background: var(--green); box-shadow: 0 0 12px var(--green); }
.perm-dot.denied  { background: var(--red);   box-shadow: 0 0 12px var(--red); }
.perm-dot.default { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.perm-text b { font-weight: 600; }
.perm-text small { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }

/* ===== Botões ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; border: none; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 600;
  padding: 14px 18px; border-radius: 14px; color: #fff;
  transition: transform .08s ease, filter .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent-grad); color: #001; box-shadow: 0 8px 24px rgba(10,132,255,.35); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-sale { background: linear-gradient(135deg, #2ed573, #12b85f); color: #022; box-shadow: 0 8px 24px rgba(46,213,115,.30); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.btn-danger { background: var(--surface-2); border: 1px solid rgba(255,77,94,.4); color: var(--red); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { width: auto; flex: 1; }

/* ===== Payload preview (estrutura, neutro — não é a casca do iOS) ===== */
.notif-preview {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px;
}
.notif-preview .np-icon { width: 42px; height: 42px; border-radius: 10px; flex: none; }
.notif-preview .np-body { flex: 1; min-width: 0; }
.notif-preview .np-title { font-weight: 700; font-size: 15px; line-height: 1.25; }
.notif-preview .np-text { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.notif-preview .np-time { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.notif-preview .np-head { display: flex; justify-content: space-between; gap: 8px; }

/* estrutura de campos (chave/valor) */
.fields { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
.field { display: flex; gap: 10px; font-size: 12.5px; padding: 3px 0; }
.field .k { color: var(--cyan); font-weight: 600; min-width: 74px; flex: none; font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.field .v { color: var(--text-2); word-break: break-word; font-family: ui-monospace, 'SF Mono', Menlo, monospace; }

/* ===== Controles / form ===== */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ctl { margin-bottom: 12px; }
.ctl label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.ctl input, .ctl select {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 14px;
  padding: 11px 12px; border-radius: 11px; outline: none;
}
.ctl input:focus, .ctl select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(2,209,249,.15); }
.ctl select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23a7adc9' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

.switch { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.switch span { font-size: 14px; }
.toggle { position: relative; width: 46px; height: 27px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .track { position: absolute; inset: 0; background: var(--surface-3); border-radius: 999px; transition: .2s; border: 1px solid var(--border); }
.toggle .thumb { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; transition: .2s; }
.toggle input:checked + .track { background: var(--accent-grad); border-color: transparent; }
.toggle input:checked + .track + .thumb { transform: translateX(19px); }

/* ===== Simulador stats ===== */
.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat { background: var(--bg); border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px 10px; text-align: center; }
.stat .val { font-size: 19px; font-weight: 700; }
.stat .val.green { color: var(--green); }
.stat .lbl { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }

/* ===== Feed / log ===== */
.feed { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.feed:empty::after { content: 'Nenhuma venda disparada ainda.'; color: var(--text-3); font-size: 13px; padding: 8px 2px; }
.feed-item {
  display: flex; gap: 11px; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 10px 12px;
  animation: pop .35s cubic-bezier(.2,.9,.3,1.3);
}
.feed-item .fi-icon { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.feed-item .fi-body { flex: 1; min-width: 0; }
.feed-item .fi-title { font-size: 13.5px; font-weight: 600; }
.feed-item .fi-val { font-size: 13px; color: var(--green); font-weight: 600; }
.feed-item .fi-time { font-size: 11px; color: var(--text-3); white-space: nowrap; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

.hint { font-size: 12px; color: var(--text-3); line-height: 1.5; margin-top: 4px; }
.hint code { color: var(--cyan); font-family: ui-monospace, monospace; background: rgba(2,209,249,.08); padding: 1px 5px; border-radius: 5px; }
.footer { text-align: center; color: var(--text-3); font-size: 11px; margin-top: 26px; line-height: 1.6; }
.footer b { color: var(--text-2); }
.divider { height: 1px; background: var(--border-soft); margin: 4px 0 16px; }

.pulse-live { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 12px; font-weight: 600; }
.pulse-live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(46,213,115,.6); animation: live 1.4s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(46,213,115,.55); } 70% { box-shadow: 0 0 0 8px rgba(46,213,115,0); } 100% { box-shadow: 0 0 0 0 rgba(46,213,115,0); } }
.hidden { display: none !important; }
