/* ============================================================
   boostdelivery — design system (SaaS moderno, mobile-first)
   ============================================================ */

:root {
  /* Marca — amarelo & preto (BOOOST DELIVERY) */
  --brand: #f5c518;
  --brand-2: #ffd23f;
  --brand-dark: #d9a900;
  --brand-ink: #3d2f00;
  --brand-soft: #fff8e1;
  --brand-grad: linear-gradient(135deg, #ffd23f 0%, #f5c518 100%);
  --black: #0a0a0a;
  --black-2: #171717;

  /* Neutros (slate) */
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e9edf2;
  --line-2: #f1f4f8;
  --bg: #f7f8fb;
  --card: #ffffff;

  /* Estados */
  --ok: #16a34a;
  --ok-soft: #ecfdf5;
  --err: #e11d48;
  --err-soft: #fff1f3;
  --warn: #b45309;
  --warn-soft: #fffbeb;

  /* Raios (escala concêntrica) */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* Sombras em camadas */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06),
    0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06),
    0 12px 28px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.1),
    0 30px 60px rgba(15, 23, 42, 0.12);
  --ring: 0 0 0 4px rgba(245, 197, 24, 0.4);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

img {
  outline: 1px solid rgba(0, 0, 0, 0.08);
  outline-offset: -1px;
}

a {
  color: var(--brand-dark);
}

::selection {
  background: rgba(245, 197, 24, 0.35);
}

/* ---------- Logo (wordmark BOOOST DELIVERY sobre preto) ---------- */
.logo-lockup {
  display: inline-block;
  height: 72px;
  width: 208px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--black);
  box-shadow: var(--shadow-md);
  flex: none;
}

.logo-lockup img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  outline: none;
}

.logo-lockup.sm {
  height: 40px;
  width: 118px;
  border-radius: 10px;
  box-shadow: none;
}

/* Barra de marca do topo do admin (logo + rótulo) */
.brand-bar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-bar .bar-title {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  opacity: 0.92;
}

/* ============================================================
   Página pública
   ============================================================ */
.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 56px;
  position: relative;
  isolation: isolate;
}

/* brilho de fundo suave no topo */
.page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 340px;
  z-index: -1;
  background: radial-gradient(
      70% 120% at 50% -10%,
      rgba(245, 197, 24, 0.22),
      rgba(245, 197, 24, 0) 70%
    ),
    linear-gradient(180deg, #fff, var(--bg));
}

.page > .logo-lockup {
  margin: 6px 0 20px;
}

.hero {
  text-align: center;
  max-width: 480px;
  margin-bottom: 18px;
}

.hero .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-ink);
  background: var(--brand-soft);
  border: 1px solid rgba(255, 90, 31, 0.18);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  margin-bottom: 14px;
}

.card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: 26px 24px;
}

.card h1 {
  font-size: clamp(22px, 5vw, 27px);
  line-height: 1.15;
  margin: 0 0 6px;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.card .sub {
  color: var(--muted);
  margin: 0 0 22px;
  font-size: 15px;
  text-wrap: pretty;
}

/* ---------- Formulário ---------- */
.field {
  margin-bottom: 15px;
}

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 7px;
}

.field .req {
  color: var(--brand);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 13px;
  font-size: 16px; /* evita zoom no iOS */
  font-family: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition-property: border-color, box-shadow, background-color;
  transition-duration: 160ms;
  transition-timing-function: ease-out;
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted-2);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--err);
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.12);
}

.field .error {
  display: none;
  color: var(--err);
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 6px;
}

.field.invalid .error {
  display: block;
}

.hidden {
  display: none !important;
}

/* ---------- Botões ---------- */
.btn {
  width: 100%;
  padding: 14px 18px;
  font-size: 15.5px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: -0.01em;
  color: var(--black);
  background: var(--brand-grad);
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(245, 197, 24, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition-property: transform, box-shadow, background-color, opacity, filter;
  transition-duration: 160ms;
  transition-timing-function: ease-out;
}

.btn:hover {
  filter: brightness(1.04);
  box-shadow: 0 8px 22px rgba(245, 197, 24, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn.secondary {
  background: #fff;
  color: var(--ink-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.btn.secondary:hover {
  background: #fbfcfe;
  border-color: #dbe1e9;
  filter: none;
}

.btn.small {
  width: auto;
  padding: 9px 14px;
  font-size: 13.5px;
  border-radius: var(--r-sm);
}

/* ---------- Mensagens ---------- */
.form-msg {
  margin-top: 14px;
  font-size: 13.5px;
  font-weight: 500;
  padding: 11px 13px;
  border-radius: var(--r-md);
  display: none;
  text-wrap: pretty;
}

.form-msg.error {
  display: block;
  background: var(--err-soft);
  color: var(--err);
  border: 1px solid rgba(225, 29, 72, 0.2);
}

.form-msg.warn {
  display: block;
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid #fde68a;
}

/* ---------- Tela de sucesso ---------- */
.success {
  text-align: center;
  padding: 14px 6px;
  animation: pop-in 0.4s ease-out both;
}

.success .check {
  width: 72px;
  height: 72px;
  margin: 6px auto 18px;
  border-radius: var(--r-pill);
  background: var(--ok-soft);
  color: var(--ok);
  display: grid;
  place-items: center;
  font-size: 36px;
  box-shadow: 0 0 0 8px rgba(22, 163, 74, 0.06);
}

.success h2 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.success p {
  color: var(--muted);
  margin: 0 0 20px;
  text-wrap: pretty;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.foot {
  margin-top: 22px;
  text-align: center;
  color: var(--muted-2);
  font-size: 12.5px;
}

/* ============================================================
   Painel admin
   ============================================================ */
.admin-body {
  background: var(--bg);
}

.topbar {
  background: var(--black);
  border-bottom: 1px solid #232323;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .who {
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 500;
}

.topbar .btn.secondary {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

.topbar .btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
}

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 22px 18px 64px;
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 4px 0 2px;
}

.page-title + .page-desc {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 14px;
}

/* Login centralizado */
.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  position: relative;
  isolation: isolate;
}

.login-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    60% 60% at 50% 0%,
    rgba(255, 138, 61, 0.14),
    rgba(255, 138, 61, 0) 70%
  );
}

/* Contadores por status */
.counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0 18px;
}

.counter {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
  transition-property: transform, box-shadow, border-color;
  transition-duration: 160ms;
  transition-timing-function: ease-out;
}

.counter:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: #dde3ea;
}

.counter::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent, var(--muted-2));
}

.counter .n {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.counter .l {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 6px;
}

.counter.c-total {
  --accent: var(--ink);
}
.counter.c-novo {
  --accent: #2563eb;
}
.counter.c-em_analise {
  --accent: #d97706;
}
.counter.c-proposta_enviada {
  --accent: #7c3aed;
}
.counter.c-fechado {
  --accent: #059669;
}
.counter.c-descartado {
  --accent: #94a3b8;
}

/* Barra de ferramentas */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.search-box {
  position: relative;
  flex: 1 1 260px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}

.toolbar input[type="search"] {
  width: 100%;
  padding: 11px 14px 11px 38px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition-property: border-color, box-shadow;
  transition-duration: 160ms;
  transition-timing-function: ease-out;
}

.toolbar input[type="search"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}

/* Lista de leads */
.leads-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.leads-table th,
.leads-table td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: top;
}

.leads-table th {
  background: #fbfcfe;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.leads-table tbody tr {
  transition: background-color 140ms ease-out;
}

.leads-table tbody tr:hover {
  background: #fcfdff;
}

.leads-table tr:last-child td {
  border-bottom: none;
}

.leads-table td[data-label="Data"] {
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.leads-table select,
.leads-table textarea {
  width: 100%;
  padding: 8px 9px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  transition-property: border-color, box-shadow;
  transition-duration: 140ms;
}

.leads-table select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

.leads-table select:focus,
.leads-table textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}

.leads-table textarea {
  min-height: 42px;
  resize: vertical;
}

.cell-contato {
  white-space: nowrap;
  line-height: 1.5;
}

.cell-contato a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  font-size: 12.5px;
}

/* Badges de status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-novo {
  background: #eff6ff;
  color: #1d4ed8;
}
.status-em_analise {
  background: #fff7ed;
  color: #c2410c;
}
.status-proposta_enviada {
  background: #f5f3ff;
  color: #6d28d9;
}
.status-fechado {
  background: #ecfdf5;
  color: #047857;
}
.status-descartado {
  background: #f1f5f9;
  color: #64748b;
}

.wa-link {
  color: var(--ok);
  font-weight: 600;
  text-decoration: none;
}

.wa-link:hover {
  text-decoration: underline;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 18px;
  font-size: 14px;
}

.saved-flash {
  display: inline-block;
  color: var(--ok);
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 4px;
  opacity: 0;
  transform: translateY(2px);
  transition-property: opacity, transform;
  transition-duration: 200ms;
  transition-timing-function: ease-out;
}

.saved-flash.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsivo: em telas pequenas a tabela vira cartões empilhados */
@media (max-width: 760px) {
  .leads-card {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }

  .leads-table,
  .leads-table thead,
  .leads-table tbody,
  .leads-table tr,
  .leads-table th,
  .leads-table td {
    display: block;
  }

  .leads-table thead {
    display: none;
  }

  .leads-table tr {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    margin-bottom: 12px;
    padding: 6px 6px;
    background: var(--card);
    box-shadow: var(--shadow-xs);
  }

  .leads-table tbody tr:hover {
    background: var(--card);
  }

  .leads-table td {
    border-bottom: 1px dashed var(--line);
    padding: 10px 12px;
  }

  .leads-table td:last-child {
    border-bottom: none;
  }

  .leads-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-2);
    margin-bottom: 5px;
  }
}
