:root {
  --bg-white: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.94);
  --border-light: rgba(0, 0, 0, 0.08);
  --border-cyan: rgba(2, 132, 199, 0.35);
  --cyan: #0284c7;
  --cyan-bright: #00f0ff;
  --text-dark: #090d16;
  --text-body: #334155;
  --text-muted: #64748b;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Outfit", Helvetica, Arial, sans-serif;
  --font-serif: "Cinzel", "Playfair Display", Georgia, serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-white);
  background-image: 
    radial-gradient(circle at 65% 45%, rgba(56, 189, 248, 0.07) 0%, transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(203, 213, 225, 0.4) 0%, transparent 60%);
  color: var(--text-dark);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==================== TELA DE LOGIN (ESTÚDIO BRANCO DE LUXO) ==================== */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
  background: #ffffff;
  background-image: 
    radial-gradient(circle at 50% 35%, rgba(241, 245, 249, 1) 0%, #ffffff 85%),
    radial-gradient(circle at 60% 40%, rgba(56, 189, 248, 0.09) 0%, transparent 45%);
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: 28px;
  width: 100%;
  max-width: 440px;
  padding: 40px 32px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.03),
    0 10px 25px -5px rgba(2, 132, 199, 0.06);
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand-motto {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 22px;
  font-weight: 600;
}

.brand-header {
  text-align: center;
  margin-bottom: 28px;
}

/* LOGO ESFÉRICA PRETA COM HOLOGRAMA LD */
.brand-logo {
  width: 110px;
  height: 110px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.22)) drop-shadow(0 0 20px rgba(0, 240, 255, 0.3));
  transition: transform 0.3s ease;
}

.brand-logo:hover {
  transform: scale(1.05);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #090d16;
}

.brand-title sup {
  font-size: 12px;
  font-weight: 700;
  color: #0284c7;
}

.brand-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.25);
  color: #0284c7;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-top: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  color: #090d16;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.input-field:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}

/* BOTÃO PRETO PIANO / ALTO CONTRASTE */
.btn-primary {
  width: 100%;
  background: #090d16;
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  padding: 15px;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3), 0 0 15px rgba(2, 132, 199, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 15px 25px -5px rgba(2, 132, 199, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.error-msg {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #e11d48;
  font-size: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  display: none;
}

/* ==================== PORTAL PRINCIPAL (APP SHELL) ==================== */
#appPortal {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  background: #ffffff;
}

.top-bar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.top-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-brand {
  font-size: 17px;
  font-weight: 800;
  color: #090d16;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-online {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-offline {
  background: rgba(244, 63, 94, 0.12);
  color: #e11d48;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  font-size: 12px;
  color: #475569;
  background: #f1f5f9;
  padding: 5px 12px;
  border-radius: 8px;
  font-weight: 600;
  display: none;
}

@media(min-width: 600px) {
  .user-badge { display: block; }
}

.btn-ghost {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ghost:hover {
  background: #f1f5f9;
  color: #090d16;
}

/* TABS DE NAVEGAÇÃO */
.nav-tabs-bar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 16px;
  gap: 8px;
}

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

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #090d16;
  background: rgba(0, 0, 0, 0.04);
}

.tab-btn.active {
  color: #ffffff;
  background: #090d16;
  border-color: #090d16;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* IFRAME CONTAINER FLEXÍVEL */
.viewport-container {
  flex: 1;
  width: 100%;
  min-height: calc(100vh - 110px);
  background: #000000;
  display: flex;
  flex-direction: column;
}

.content-frame {
  width: 100%;
  flex: 1;
  height: calc(100vh - 110px);
  min-height: 85vh;
  border: none;
  display: block;
  background: #000000;
}

/* PAINEL DE CONFIGURAÇÃO DO TÚNEL */
.tunnel-card {
  padding: 28px;
  max-width: 680px;
  margin: 30px auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.tunnel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
