/* 
 * CSS Migrado do Simplifica App SPA 
 * Paridade 1:1 Garantida
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ===== CORREÇÃO DE OVER-SCROLL (body não rola; só o conteúdo entre header e tabbar) ===== */
html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #070d2e;
}

#spa-root {
  position: fixed; left:0; right:0; bottom:0; top: var(--wpbar, 0px);
  z-index: 2;
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --bg:#070d2e; --panel:#0b1140; --card:#0f165c; --line:#23306b; --tx:#ebefff; --mut:#a8b4ff;
  --cta1:#7dd3fc; --cta2:#38bdf8; --chip:#142572; --ok:#4ade80;
  --hdr:64px; --tab:100px;
  color: var(--tx);
}
#spa-root, #spa-root * { box-sizing: border-box; color: var(--tx); }
input[readonly], select[readonly] { background: rgba(0,0,0,0.2) !important; color: #888 !important; cursor: not-allowed !important; opacity: 0.7; }

.spa-header {
  position: absolute; top:0; left:0; right:0; height: var(--hdr);
  background: var(--panel);
  background: radial-gradient(120% 120% at 50% -20%, rgba(255,255,255,.06), rgba(0,0,0,.2) 60%),
              linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.05)),
              var(--panel);
  border-bottom: 1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between;
  padding: 0 16px;
}
.spa-header .brand { display:flex; align-items:center; gap:3px; }
.spa-header .brand img.logo-simplifica { height: 30px; width:auto; display:block; margin-left: 12px; }
.spa-header .brand .brand-sep { width:1px; height:22px; background:rgba(255,255,255,0.12); display:block; }
.spa-header .brand img.logo-porto { height: 30px; width:auto; display:block; opacity:0.85; }

.install-btn {
  background: rgba(125,211,252,0.1); border: 1px solid rgba(125,211,252,0.2);
  border-radius: 10px; padding: 7px 14px; cursor: pointer;
  color: var(--cta1); font-size: 12px; font-weight: 700;
  transition: all .25s; display: flex; align-items: center; gap: 6px;
  letter-spacing: 0.2px;
}
.install-btn:hover { background: rgba(125,211,252,0.18); border-color: rgba(125,211,252,0.35); }
.install-btn svg { width: 14px; height: 14px; }

.spa-views {
  position: absolute; top: var(--hdr); left:0; right:0; bottom: var(--tab);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 10px 24px;
  background: var(--bg);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.spa-views::-webkit-scrollbar { width: 0; height: 0; }

#view-home, #view-home * { touch-action: pan-y !important; }
#view-home, #view-home * { scrollbar-width: none; -ms-overflow-style: none; }
#view-home::-webkit-scrollbar, #view-home *::-webkit-scrollbar { width:0!important; height:0!important; }

.wrap { max-width: 1100px; margin: 0 auto; }
.card { background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.02)); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }

.spa-tabbar {
  position: absolute; left: 14px; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); 
  height: 72px;
  background: rgba(11, 17, 64, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; border-radius: 18px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--mut); border: none; background: transparent; cursor: pointer;
}
.tab .icon { 
  font-size: 20px; 
  line-height: 1; 
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s ease;
}
.tab div:last-child { 
  font-size: 9px; 
  font-weight: 800; 
  text-transform: uppercase; 
  letter-spacing: 0.4px; 
  opacity: 0.7;
}

.tab:active { transform: scale(0.92); }

.tab.active {
  color: var(--cta1);
  background: rgba(125, 211, 252, 0.12);
}
.tab.active .icon { 
  transform: translateY(-2px); 
  color: var(--cta1); 
}
.tab.active div:last-child { 
  opacity: 1; 
  color: var(--cta1);
}

/* ======================= PAYWALL ELITE DESIGN ======================= */
.spa-paywall {
  padding: 80px 40px;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.12), transparent 70%), rgba(11, 17, 64, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 48px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin: 40px auto;
  max-width: 580px;
  position: relative;
  box-shadow: 
    0 40px 100px rgba(0,0,0,0.4),
    inset 0 0 30px rgba(255,255,255,0.02);
  animation: wallEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wallEntrance {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.wall-icon {
  width: 64px !important;
  height: 64px !important;
  min-width: 64px;
  min-height: 64px;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.15), rgba(56, 189, 248, 0.02));
  border-radius: 20px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 auto 24px !important;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.1);
  color: var(--cta1);
  position: relative;
  overflow: visible;
}

.wall-icon svg {
  width: 28px !important;
  height: 28px !important;
  display: block;
  filter: drop-shadow(0 0 8px var(--cta1));
}

/* Efeito de brilho pulsante atrás do ícone */
.wall-icon::after {
  content: '';
  position: absolute;
  inset: -15px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15), transparent 70%);
  z-index: -1;
  animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

.paywall-header h1 {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 12px;
  color: #fff;
  letter-spacing: -0.5px;
  background: linear-gradient(to bottom, #fff, rgba(255,255,255,0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.paywall-header p {
  color: rgba(255, 255, 255, 0.45);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.paywall-action {
  width: auto;
  min-width: 220px;
  padding: 16px 32px;
  border: none;
  border-radius: 16px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--cta1), var(--cta2));
  color: #050a30 !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.3);
  letter-spacing: 0.3px;
}

.paywall-action:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(56, 189, 248, 0.5);
  filter: brightness(1.15);
}

.paywall-action:active {
  transform: translateY(-2px) scale(0.98);
}

/* Cards de Upgrade (Para usuários logados sem Pro) */
.paywall-cards {
    display: flex; justify-content: center; width: 100%; margin-top: 24px;
}
.plan-card {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(125,211,252,0.2); border-radius: 24px; padding: 32px;
    backdrop-filter: blur(10px); display: flex; flex-direction: column; align-items: center; text-align: center;
    position: relative; overflow: hidden; width: 100%; max-width: 320px;
    transition: transform 0.3s ease;
}
.plan-card:hover { transform: translateY(-5px); border-color: var(--cta1); }
.plan-card h3 { margin: 0 0 8px; font-size: 20px; font-weight: 800; color: #fff; }
.plan-card .price { font-size: 36px; font-weight: 900; margin: 16px 0; color: #fff; }
.plan-card .price small { font-size: 14px; font-weight: 500; color: var(--mut); }


.support-btn {
    margin-top: auto; display: flex; align-items: center; gap: 8px; color: var(--mut); font-size: 13px; text-decoration: none;
    padding: 12px 20px; border-radius: 99px; border: 1px solid var(--line);
}

.spa-placeholder { padding: 16px; border:1px dashed var(--line); border-radius: 16px; color: var(--mut); }

/* Compactação específica dos cards de plano no Checkout */
#sc-checkout-modal .plan-card {
    padding: 12px 8px; border-radius: 14px; align-items: center; text-align: center;
    min-height: 90px; cursor: pointer; transition: all .2s; border: 1px solid var(--line);
    background: rgba(255,255,255,0.03); justify-content: center;
}
#sc-checkout-modal .plan-card input { display: none; }
#sc-checkout-modal .plan-card:has(input:checked) {
    border-color: var(--cta1);
    background: rgba(125,211,252,0.1);
    box-shadow: 0 0 15px rgba(56,189,248,0.2);
}
#sc-checkout-modal .plan-info { display: flex; flex-direction: column; gap: 2px; width: 100%; }
#sc-checkout-modal .p-name { font-size: 10px; text-transform: uppercase; color: var(--mut); font-weight: 700; margin-bottom: 2px; }
#sc-checkout-modal .p-cycle { font-size: 14px; font-weight: 800; color: #fff; }
#sc-checkout-modal .p-price { 
    display: flex; flex-direction: column; align-items: center; gap: 0;
    margin-top: 4px; line-height: 1;
}
#sc-checkout-modal .p-price-row {
    display: flex; align-items: flex-start; justify-content: center; gap: 2px;
    color: #fff; white-space: nowrap;
}
#sc-checkout-modal .p-price .price-symbol { font-size: 9px; font-weight: 800; margin-top: 3px; }
#sc-checkout-modal .p-price .price-amt { font-size: 20px; font-weight: 900; }
#sc-checkout-modal .p-price .price-suffix { font-size: 9px; font-weight: 600; color: var(--mut); opacity: 0.7; margin-top: 2px; }

.plan-grid {
    display: grid; 
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (max-width: 500px) {
    .plan-grid { grid-template-columns: repeat(2, 1fr); }
    #sc-checkout-modal .plan-card { min-height: 80px; padding: 10px 5px; }
    #sc-checkout-modal .p-cycle { font-size: 13px; }
    #sc-checkout-modal .p-price { font-size: 12px; }
}

body.admin-bar #spa-root { --wpbar: 32px; }
@media (max-width: 782px) { body.admin-bar #spa-root { --wpbar: 46px; } }
@media (max-width: 560px){
  .spa-header { padding: 0 12px; }
}

/* ===== FIX: botões do modal com texto escuro (padrão simulador) ===== */
.sc-btn,
.sc-btn * {
  color: #050a30 !important;
  -webkit-text-fill-color: #050a30 !important;
  text-shadow: none !important;
}

/* Badge "Beta" do modal */
.sc-modal-badge,
.sc-modal-badge * {
  color: #050a30 !important;
  -webkit-text-fill-color: #050a30 !important;
}

/* ======================= MODAL DE BOAS-VINDAS (BETA) ======================= */
.sc-modal-backdrop{
  position: fixed; inset: 0; z-index: 99999;
  display: none; /* JS troca para flex ao abrir */
  align-items: center; justify-content: center;
  background: rgba(3, 6, 24, 0.84);
  backdrop-filter: blur(2px);
}
.sc-modal-backdrop::before{
  content:''; position:absolute; inset:0; pointer-events:none;
  background:
    radial-gradient(120% 120% at 50% 10%, rgba(0,0,0,.45), rgba(0,0,0,.65));
}
.sc-modal-box{
  position: relative;
  width: min(92vw, 580px);
  background: rgba(11, 17, 64, 0.96);
  border: 1px solid rgba(120,150,255,.30);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(120,150,255,.18) inset;
  padding: 22px 20px 16px;
  animation: sc-pop-in .18s ease-out;
  overflow-x: hidden;
}
@keyframes sc-pop-in {
  from { transform: translateY(4px) scale(.98); opacity: .0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.sc-modal-badge{
  display:inline-flex; align-items:center; gap:8px;
  font-weight: 800; font-size: 12px; letter-spacing:.3px;
  padding: 6px 10px; border-radius: 999px;
  background: linear-gradient(180deg, var(--cta1), var(--cta2));
  color:#050a30; box-shadow: 0 10px 22px rgba(56,189,248,.30);
}
.sc-modal-head{
  display:flex; align-items:center; gap:12px; margin-bottom: 10px;
}
.sc-modal-icon{
  width:36px; height:36px; border-radius:10px;
  display:grid; place-items:center;
  background: #0f1a77;
  border:1px solid rgba(120,150,255,.30);
  box-shadow: 0 8px 20px rgba(56,189,248,.16);
  font-size: 18px;
}
.sc-modal-title{
  font-weight: 900; font-size: 20px; line-height: 1.25;
}
.sc-modal-content p{ margin: 10px 0; color: var(--tx); }
.sc-modal-content b{ color: var(--tx); }
.sc-modal-actions{
  display:flex; align-items:center; justify-content: space-between;
  gap: 12px; margin-top: 16px;
}
.sc-modal-left{
  display:flex; align-items:center; gap:8px; font-size: 14px; color: var(--mut);
}
.sc-checkbox{ width:18px; height:18px; accent-color: var(--cta2); }
.sc-btn{
  border: none; padding: 12px 16px; border-radius: 12px;
  font-weight: 800; cursor: pointer;
  background: linear-gradient(180deg, var(--cta1), var(--cta2));
  color:#050a30;
  box-shadow: 0 10px 22px rgba(56,189,248,.30);
}
.sc-modal-meta{
  margin-top: 8px; font-size: 12px; color: var(--mut);
}

/* INTEGRAÇÃO VISUAL WP-ADMIN -> SPA DARK (Adicionado para painel de usuários) */
#sc-admin-container .wrap h1 { display: none; }
#sc-admin-container table.widefat {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--tx) !important;
}
#sc-admin-container table.widefat thead th {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--cta1) !important;
    border-bottom: 1px solid var(--line) !important;
    text-transform: uppercase; font-size: 11px; letter-spacing: 1px;
}
#sc-admin-container table.widefat tbody td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
    padding: 15px 10px !important;
    vertical-align: middle !important;
}
#sc-admin-container .button-small {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--line) !important;
    color: #fff !important;
    border-radius: 8px !important;
}
/* 
 * Correção de contraste para Inputs do Portal 
 * Evita o problema "Branco sobre Branco"
 */
.chk-input, 
#spa-root input[type="text"], 
#spa-root input[type="email"], 
#spa-root input[type="number"], 
#spa-root select { 
    width: 100% !important; 
    background: rgba(255, 255, 255, 0.05) !important; 
    border: 1px solid var(--line) !important; 
    border-radius: 8px !important; 
    padding: 10px !important; 
    color: #ffffff !important; 
    font-size: 14px !important; 
    font-weight: 500 !important;
    transition: all 0.2s !important; 
    box-shadow: none !important;
}

.chk-input:focus,
#spa-root input:focus,
#spa-root select:focus {
    border-color: var(--cta1) !important;
    outline: none !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Estilo específico para dropdowns e suas opções */
#spa-root select option {
    background: #0b1140 !important;
    color: #ffffff !important;
}

input[readonly], select[readonly] { 
    background: rgba(0, 0, 0, 0.3) !important; 
    color: var(--mut) !important; 
    cursor: not-allowed !important; 
    opacity: 0.8 !important; 
    border: 1px solid rgba(255,255,255,0.05) !important;
}

.field-label { 
    font-size: 14px !important; 
    color: #ffffff !important; 
    margin-bottom: 6px !important; 
    display: block !important; 
    font-weight: 700 !important; 
    text-transform: none !important;
}


/* ======================= HUB (ABA MAIS) ======================= */
.hub-container {
  padding: 60px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: aiFadeIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 130px);
  gap: 30px;
  width: 100%;
  max-width: 700px;
  justify-content: center;
}
.hub-item {
  width: 130px;
  height: 130px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border-radius: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  padding: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.hub-item:hover {
  transform: translateY(-8px) scale(1.03);
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}
.hub-item:active { transform: scale(0.94); }
.hub-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-size: 32px;
}
.hub-icon img { width: 44px; height: 44px; display: block; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.4)); }
.hub-item:hover .hub-icon { transform: scale(1.1); }
.hub-label {
  font-size: 6.5px;
  font-weight: 700;
  color: var(--tx);
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  width: 100%;
  opacity: 0.5;
  transition: 0.3s;
}
.hub-item:hover .hub-label { opacity: 1; letter-spacing: 1.5px; color: var(--cta1); }

@keyframes aiFadeIn { from { opacity:0; transform:scale(0.9) translateY(30px); } to { opacity:1; transform:scale(1) translateY(0); } }

@media (max-width: 450px) {
  .hub-grid { gap: 15px; grid-template-columns: repeat(auto-fill, 115px); }
  .hub-item { width: 115px; height: 115px; border-radius: 30px; }
  .hub-icon { width: 50px; height: 50px; font-size: 28px; }
  .hub-icon img { width: 38px; height: 38px; }
}

/* Forçar texto escuro nos botões de paywall e login */
#spa-root .paywall-action,
#spa-root .trigger-login {
    color: #050a30 !important;
}
