/* ======================================================
   ZAPFLUI — UI BASE (SEGURO PARA JS / BACKEND)
   NÃO ALTERA IDS NEM CLASSES FUNCIONAIS
   ====================================================== */

/* =============================
   VARIÁVEIS
============================= */
:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1f2430;
  --border: #2a2f3a;

  --text: #e5e7eb;
  --muted: #9ca3af;

  --brand: #7c3aed;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;

  --radius: 14px;
  --shadow: 0 30px 60px rgba(0,0,0,.45);
  --shadow-soft: 0 14px 30px rgba(0,0,0,.25);
}

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

body {
  font-family: Inter, system-ui, Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -200px, #1b1f2a, var(--bg)),
    radial-gradient(800px 400px at 90% 0%, rgba(124,58,237,.08), transparent);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

h1, h2, h3 {
  letter-spacing: .2px;
}

h1 {
  font-size: clamp(24px, 2.2vw, 32px);
}

h2 {
  font-size: clamp(20px, 2vw, 26px);
}

h3 {
  font-size: clamp(16px, 1.5vw, 20px);
}

/* =============================
   LAYOUT
============================= */
.main-header {
  max-width: 1180px;
  margin: 16px auto 24px;
  padding: 14px 18px;
  display: flex;
  flex-direction: row;
  align-items: center;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(17,20,30,.92), rgba(12,15,24,.94));
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.04);
  gap: 14px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--brand);
  margin: 2px auto 4px;
}

.logo-img {
  height: 52px;
  width: auto;
  border-radius: 12px;
  display: block;
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(255,255,255,.02);
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.06);
  margin-left: auto;
  margin-right: auto;
}

.nav a {
  font-size: 13px;
  color: var(--muted);
  padding: 9px 13px;
  border-radius: 12px;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}

.nav-group {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,.08);
  margin-left: 8px;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.08);
}

.nav a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(124,58,237,.35), rgba(124,58,237,.12));
  box-shadow: 0 10px 24px rgba(124,58,237,.28);
  border-color: rgba(124,58,237,.35);
}

.container {
  max-width: 1180px;
  margin: auto;
  padding: 0 28px 64px;
}

/* =============================
   CARD
============================= */
.card {
  background: linear-gradient(
    180deg,
    rgba(255,255,255,.05),
    rgba(255,255,255,.02)
  );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(18px, 2.4vw, 28px);
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

section + section {
  margin-top: 20px;
}

/* =============================
   STATUS BADGE
============================= */
.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.success {
  background: rgba(34,197,94,.15);
  color: var(--success);
}

.badge.warning {
  background: rgba(234,179,8,.15);
  color: var(--warning);
}

.badge.danger {
  background: rgba(239,68,68,.15);
  color: var(--danger);
}

/* =============================
   BOTÕES
============================= */
button {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: white;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all .2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(124,58,237,.35);
}

button:active {
  transform: translateY(0);
}

/* secundário */
button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

button.secondary:hover {
  background: rgba(255,255,255,.05);
  box-shadow: none;
}

/* perigo */
button.danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

button.danger:hover {
  box-shadow: 0 10px 30px rgba(239,68,68,.35);
}

/* =============================
   QR BOX
============================= */
.qr-box {
  margin-top: 24px;
  padding: 24px;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,.04),
    rgba(255,255,255,.02)
  );
  border: 1px dashed rgba(255,255,255,.15);
  border-radius: 14px;
  text-align: center;
}

.qr-box img {
  margin-top: 10px;
  max-width: 260px;
}

/* =============================
   INPUTS BASE
============================= */
input, select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.25);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border .2s ease, box-shadow .2s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(124,58,237,.6);
  box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}

/* =============================
   UTILITÁRIOS
============================= */
.card > * + * {
  margin-top: 14px;
}

/* =============================
   RESPONSIVO
============================= */
@media (max-width: 768px) {
  .main-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 16px;
    margin: 12px auto 16px;
    position: sticky;
    top: 8px;
    z-index: 20;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto;
    padding: 6px 6px 8px;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .container {
    padding: 0 16px 48px;
  }

  .logo img {
    height: 44px;
  }

  .nav a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 10px 13px;
    font-size: 12.5px;
    border-radius: 12px;
    scroll-snap-align: start;
  }
}

/* =============================
   CONNECTIONS
============================= */
.connections-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  margin-top: 16px;
}

.connections-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.connections-items {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.connections-item {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.2);
  color: var(--text);
  cursor: pointer;
}

.connections-item.active {
  border-color: rgba(124,58,237,.6);
  background: linear-gradient(135deg, rgba(124,58,237,.25), rgba(124,58,237,.05));
}

.connections-detail select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color: var(--text);
}

@media (max-width: 900px) {
  .connections-shell {
    grid-template-columns: 1fr;
  }
}

/* =============================
   FOOTER PADRÃO
============================= */
.app-footer {
  margin-top: 80px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,.2);
}

.footer-inner {
  max-width: 1100px;
  margin: auto;
  padding: 0 32px;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.footer-left strong {
  color: var(--text);
}

.footer-links a {
  margin-left: 16px;
  font-size: 13px;
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--text);
}

.footer-right {
  font-size: 12px;
  color: var(--muted);
}

/* Responsivo */
@media (max-width: 768px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links a {
    margin: 0 8px;
  }
}

/* =============================
   FOOTER — PROFESSIONAL SAAS
============================= */
.footer {
  margin-top: 80px;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,.02),
    rgba(255,255,255,.01)
  );
  border-top: 1px solid var(--border);
}

.footer-compact {
  margin-top: 40px;
}

.footer-compact .footer-container {
  padding: 28px 32px;
}

.footer-compact .footer-nav {
  display: none;
}

.footer-compact .footer-bottom {
  border-top: none;
  padding-top: 0;
}

.footer-public {
  background: radial-gradient(600px 240px at 50% 0%, rgba(124,58,237,.14), transparent 60%);
}

.footer-public .footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  text-align: center;
}

.footer-public .footer-nav {
  display: none;
}

.footer-public .footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-public-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.footer-public-links a {
  color: var(--muted);
}

.footer-public-links a:hover {
  color: var(--text);
}

.footer-public .footer-bottom {
  border-top: none;
  justify-content: center;
  gap: 14px;
}

.public-page .footer-public {
  margin-top: 0;
}

.footer-container {
  max-width: 1100px;
  margin: auto;
  padding: 48px 32px;

  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 48px;
}

.footer-brand {
  max-width: 320px;
}

.footer-logo {
  height: 28px;
  margin-bottom: 12px;
}

.footer-description {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.footer-col a {
  font-size: 13px;
  color: var(--muted);
  transition: color .2s ease;
}

.footer-col a:hover {
  color: var(--text);
}

/* BOTTOM */
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;

  max-width: 1100px;
  margin: auto;
  font-size: 13px;
  color: var(--muted);
}


.footer-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(34,197,94,.6);
}

/* RESPONSIVO */
@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    padding: 40px 24px;
  }

  .footer-nav {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* Onboarding Premium */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 15, 0.7);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 9999;
  padding: 24px;
}

.onboarding-card {
  position: relative;
  max-width: 520px;
  width: 100%;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid rgba(123, 97, 255, 0.35);
  background: radial-gradient(120% 140% at 10% 0%, rgba(123, 97, 255, 0.22), rgba(20, 24, 36, 0.98) 60%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  color: #e6e8ef;
}

.onboarding-card h3 {
  margin: 14px 0 8px;
  font-size: 24px;
}

.onboarding-card p {
  margin: 0 0 14px;
  color: rgba(230, 232, 239, 0.8);
}

.onb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(20, 24, 36, 0.7);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.onb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.onb-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(140, 200, 255, 0.8);
}

.onb-step {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(123, 97, 255, 0.2);
  color: #c9c4ff;
}

.onb-progress {
  width: 100%;
  height: 6px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.onb-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #7b61ff, #4dd3ff);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.onb-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  text-decoration: none;
  background: rgba(25, 30, 46, 0.8);
  margin-bottom: 10px;
}

.onboarding-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.onboarding-actions button {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(26, 30, 45, 0.9);
  color: #fff;
  cursor: pointer;
}

.onboarding-actions .next {
  background: linear-gradient(135deg, #7b61ff, #4dd3ff);
  border: none;
  color: #0b0f1b;
  font-weight: 600;
}

.onboarding-actions .skip {
  background: rgba(255, 255, 255, 0.06);
}

.onboarding-actions .ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.onb-footnote {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(230, 232, 239, 0.6);
  text-align: center;
}

@media (max-width: 640px) {
  .onboarding-card {
    padding: 22px;
  }

  .onboarding-actions {
    flex-direction: column;
  }
}
