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

:root {
  --bg-deep:    #0b0b14;
  --bg-card:    #13131f;
  --bg-card2:   #1a1a2b;
  --bg-pro-col: #181824;
  --border:     rgba(255,255,255,0.06);
  --border-pro: #f55f9a; /* Rosa do plano ativo */
  --text-main:  #f0f0f8;
  --text-muted: #7a7a9a;
  --accent:     #9c8fff;
  --grad-btn:   linear-gradient(90deg, #f55f9a 0%, #f97316 100%);
  --grad-glow:  linear-gradient(135deg, #9c8fff22 0%, #f55f9a11 100%);
  --green:      #1dd179;
  --red:        #ff4b4b;
}

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  overscroll-behavior: none;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: 'DM Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}

/* ── Layout ── */
.app {
  max-width: 420px;
  height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-deep);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,0,0,.6);
}

.scroll-area {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 24px;
  scrollbar-width: none;
}
.scroll-area::-webkit-scrollbar { display: none; }

/* ── SPA Views (Controle de Telas) ── */
#dashboard-view, #list-view, #pro-view {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0; 
  background: var(--bg-deep);
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

#dashboard-view { z-index: 1; }
#list-view      { z-index: 2; }
#pro-view       { z-index: 3; }

.view-hidden {
  transform: translateX(100%);
  pointer-events: none;
  opacity: 0;
}

.view-active {
  transform: translateX(0);
  pointer-events: auto;
  opacity: 1;
}

/* ── Header Compartilhado ── */
.header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 20px 10px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.header-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.header-title svg { opacity: .6; }

/* ── Botões Universais ── */
.cta-btn {
  width: calc(100% - 40px);
  max-width: 360px;
  padding: 15px 24px;
  border-radius: 50px;
  background: var(--grad-btn);
  border: none;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.cta-btn:hover { opacity: .9; transform: translateY(-1px); }
.cta-btn:active { transform: scale(.98); }

/* ========================================================= */
/* ESTILOS DA TELA 1 (DASHBOARD) (Mantidos os originais)     */
/* ========================================================= */
.hero { padding: 28px 20px 20px; display: flex; flex-direction: column; align-items: center; gap: 20px; background: var(--grad-glow); }
.stats-row { width: 100%; display: flex; align-items: center; justify-content: space-around; }
.stat-block { text-align: center; }
.stat-num { font-family: 'Space Grotesk', sans-serif; font-size: 26px; font-weight: 600; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.avatar-wrap { position: relative; }
.avatar { width: 84px; height: 84px; border-radius: 50%; background: #1e1e35; border: 2px solid #2e2e50; display: flex; align-items: center; justify-content: center; }
.avatar svg { opacity: .5; }
.avatar-ring { position: absolute; inset: -5px; border-radius: 50%; border: 2px solid transparent; background: var(--grad-btn) border-box; -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0); -webkit-mask-composite: destination-out; mask-composite: exclude; opacity: .35; }
.grid-section { padding: 20px 16px 8px; }
.section-label { font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); padding: 0 4px 12px; }
.cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 18px 16px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; position: relative; overflow: hidden; cursor: pointer; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, #06b6d4, #3b82f6); opacity: .7; }
.card-num { font-family: 'Space Grotesk', sans-serif; font-size: 28px; font-weight: 600; line-height: 1; }
.card-name { font-size: 12px; color: var(--text-muted); line-height: 1.3; }
.card-change { font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 20px; width: fit-content; }
.change-up { background: rgba(29, 209, 121, .12); color: var(--green); }
.change-dn { background: rgba(255, 75, 75, .12); color: var(--red); }
.change-nt { background: rgba(156, 143, 255, .12); color: var(--accent); }

/* ========================================================= */
/* ESTILOS DA TELA 2 (LISTA)                                 */
/* ========================================================= */
.list-header { justify-content: space-between; padding-bottom: 15px;}
.icon-btn { cursor: pointer; color: var(--text-main); display: flex;}
.filter-chips { display: flex; gap: 10px; padding: 10px 20px; overflow-x: auto; flex-shrink: 0;}
.chip { padding: 8px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; font-size: 13px; color: var(--text-muted); white-space: nowrap; cursor: pointer; }
.chip.active { background: var(--text-main); color: var(--bg-deep); font-weight: 600; }
.search-box { display: flex; align-items: center; gap: 10px; background: var(--bg-card); margin: 10px 20px 20px; padding: 12px 16px; border-radius: 12px; flex-shrink: 0;}
.search-box input { flex: 1; background: transparent; border: none; color: var(--text-main); font-size: 14px; outline: none;}
#users-container { padding: 0 20px 100px; }
.user-item { display: flex; align-items: center; gap: 15px; padding: 12px 0; }
.user-avatar { width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(135deg, #7ebcf6, #dca38b); flex-shrink: 0; }
.user-info { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.user-name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.user-sub { font-size: 12px; color: var(--text-muted); }
.blur-pro { filter: blur(2px); opacity: 0.6; user-select: none; }
.pro-overlay { position: absolute; bottom: 0; left: 0; width: 100%; padding: 20px; background: linear-gradient(to top, var(--bg-deep) 60%, transparent); display: flex; justify-content: center; z-index: 10; }
.btn-pro { max-width: 100%; }

/* ========================================================= */
/* ESTILOS DA TELA 3 (PAYWALL PRO)                           */
/* ========================================================= */
.pro-header { border-bottom: none; justify-content: flex-start; padding: 20px; background: transparent;}
.pro-scroll { padding: 0 20px; }
.pro-title-area { margin-bottom: 30px; }
.pro-title { font-family: 'Space Grotesk', sans-serif; font-size: 26px; font-weight: 600; line-height: 1.2; margin-bottom: 10px; }
.pro-subtitle { font-size: 14px; color: var(--text-muted); line-height: 1.4; }

/* Tabela Comparativa */
.compare-table { margin-bottom: 30px; font-size: 13px; }
.t-row { display: grid; grid-template-columns: 1fr 60px 60px; align-items: center; border-bottom: 1px solid var(--border); }
.t-row:last-child { border-bottom: none; }
.t-header-row { font-size: 10px; font-weight: 600; color: var(--text-main); padding-bottom: 10px; }
.t-feat { padding: 12px 0; color: var(--text-main); }
.t-free, .t-pro-col { display: flex; justify-content: center; align-items: center; height: 100%; }
.t-pro-col { background: var(--bg-pro-col); border-radius: 6px; }
.t-pro-header { background: var(--bg-pro-col); border-radius: 8px 8px 0 0; padding: 8px 0; }
.t-row:last-child .t-pro-col { border-radius: 0 0 8px 8px; }
.green-chk { color: var(--green); font-weight: bold; font-size: 15px;}
.red-x { color: var(--red); font-size: 13px; opacity: 0.8;}

/* Cards de Preço */
.pricing-area { display: flex; flex-direction: column; gap: 12px; margin-bottom: 25px; }
.price-card { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: all 0.2s; }
.price-plan { font-size: 15px; font-weight: 500; }
.price-val { font-size: 14px; color: var(--text-muted); }
.price-total { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.active-price .price-total { color: var(--border-pro); font-weight: 500; }

/* Estado do Card Selecionado */
.active-price { border-color: var(--border-pro); background: rgba(245, 95, 154, 0.05); }
.active-price .price-val { color: var(--text-main); }
.price-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--border-pro); color: #fff; font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }

.btn-checkout { width: 100%; max-width: 100%; border-radius: 12px; padding: 16px; margin-bottom: 20px;}

.pro-footer-links { text-align: center; font-size: 11px; color: var(--text-muted); margin-bottom: 30px;}
.pro-footer-links a { color: var(--text-muted); text-decoration: none; border-bottom: 1px solid transparent; transition: 0.2s;}
.pro-footer-links a:hover { border-color: var(--text-muted); }
.pro-footer-links span { margin: 0 6px; opacity: 0.3; }

/* ========================================================= */
/* MODAL STYLES (Mantido original)                           */
/* ========================================================= */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; z-index: 999; }
.modal-content { background: var(--bg-card); width: 90%; max-width: 340px; padding: 30px; border-radius: 24px; border: 1px solid var(--border); text-align: center; animation: modalShow 0.3s ease-out; }
@keyframes modalShow { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-logo { width: 50px; margin-bottom: 15px; }
.modal-header h3 { font-family: 'Space Grotesk', sans-serif; margin-bottom: 5px; }
.modal-header p { font-size: 13px; color: var(--text-muted); margin-bottom: 25px; }
.input-group { margin-bottom: 12px; }
.input-group input { width: 100%; padding: 14px 16px; background: var(--bg-deep); border: 1px solid var(--border); border-radius: 12px; color: white; font-family: 'DM Sans', sans-serif; }
.input-group input:focus { outline: none; border-color: var(--accent); }
.btn-confirm { width: 100%; padding: 14px; background: var(--grad-btn); border: none; border-radius: 12px; color: white; font-weight: 600; cursor: pointer; margin-top: 10px; }
.btn-cancel { background: transparent; border: none; color: var(--text-muted); font-size: 13px; margin-top: 15px; cursor: pointer; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.txt-2fa { font-size: 12px; color: #fbbf24; margin-bottom: 10px; }
.modal-footer { font-size: 10px; color: var(--text-muted); margin-top: 25px; line-height: 1.4; }
/* ========================================== */
/* BOTÕES INFERIORES (LOGOUT + PLUS)          */
/* ========================================== */
.bottom-actions {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 20px 28px;
}

.bottom-actions.visible {
  display: flex;
}

.btn-plus {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35);
}

.btn-plus:hover { opacity: .9; }

.btn-logout-action {
  background: transparent;
  border: 1px solid #3f3f46;
  color: #a1a1aa;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}

.btn-logout-action:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* ========================================== */
/* BOTÃO DE ANÁLISE MANUAL                    */
/* ========================================== */
.analysis-control {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  padding: 0 20px;
}

#btn-analisar {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  display: none; /* Fica escondido até o login dar certo */
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

#btn-analisar:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}
/* ========================================== */
/* TELA 4: LOGIN INSTAGRAM CLONE (SPA)        */
/* ========================================== */
#login-view { z-index: 4; }

.ig-login-bg { background-color: #121b22; display: flex; flex-direction: column; }
.ig-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.ig-back-btn { cursor: pointer; display: flex; }
.ig-header-title { font-size: 16px; font-weight: 500; color: #fff; }

.ig-content { padding: 20px; display: flex; flex-direction: column; flex: 1; align-items: center; }
.ig-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; flex: 1; }
.ig-step { display: flex; flex-direction: column; align-items: center; width: 100%; flex: 1; }

/* Passo 1 - Credenciais */
.ig-lang { color: #a1aebf; font-size: 13px; margin-bottom: 35px; margin-top: 10px; }
.ig-logo { width: 70px; height: 70px; border-radius: 18px; margin-bottom: 35px; }

.ig-input-group { width: 100%; margin-bottom: 14px; }
.ig-input { width: 100%; background-color: #1c2632; border: 1px solid #36485c; border-radius: 12px; padding: 16px; color: #f5f5f5; font-size: 15px; font-family: 'DM Sans', sans-serif; transition: border 0.2s; }
.ig-input::placeholder { color: #8e9db0; }
.ig-input:focus { outline: none; border-color: #55687d; }

.ig-btn-primary { width: 100%; background-color: #0064e0; color: white; border: none; border-radius: 24px; padding: 15px; font-size: 15px; font-weight: 600; font-family: 'DM Sans', sans-serif; cursor: pointer; margin-top: 10px; transition: opacity 0.2s; }
.ig-btn-primary:active { opacity: 0.7; }

.ig-link { color: #f5f5f5; font-size: 14px; margin-top: 25px; text-decoration: none; font-weight: 500; }
.ig-spacer { flex: 1; min-height: 40px; }

.ig-btn-outline { width: 100%; background-color: transparent; color: #4fa8f7; border: 1px solid #36485c; border-radius: 24px; padding: 14px; font-size: 15px; font-weight: 600; cursor: pointer; margin-bottom: 25px; font-family: 'DM Sans', sans-serif; }
.ig-meta-logo { margin-bottom: 15px; display: flex; justify-content: center; opacity: 0.8; }

/* Passo 2 - 2FA WhatsApp */
.ig-2fa-subtitle { align-self: flex-start; color: #a1aebf; font-size: 14px; font-weight: 500; margin-bottom: 12px; margin-top: 10px; }
.ig-2fa-title { align-self: flex-start; color: #fff; font-size: 24px; font-weight: 600; line-height: 1.3; margin-bottom: 15px; }
.ig-2fa-desc { align-self: flex-start; color: #e0e0e0; font-size: 16px; margin-bottom: 25px; line-height: 1.4; }
.ig-2fa-img { width: 100%; border-radius: 16px; margin-bottom: 25px; object-fit: cover; border: 1px solid rgba(255,255,255,0.05); }
.ig-2fa-resend { display: flex; align-items: center; gap: 8px; color: #a1aebf; font-size: 14px; margin-top: 5px; margin-bottom: 20px; align-self: flex-start; }

/* Custom Checkbox */
.ig-checkbox-container { display: flex; align-items: flex-start; gap: 12px; color: #e0e0e0; font-size: 15px; cursor: pointer; user-select: none; margin-bottom: 25px; line-height: 1.4; }
.ig-checkbox-container input { display: none; }
.ig-checkmark { width: 22px; height: 22px; background-color: #0064e0; border-radius: 6px; display: flex; justify-content: center; align-items: center; flex-shrink: 0; margin-top: 0px; }
.ig-checkmark::after { content: ""; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-bottom: 2px; }

/* Footer de Segurança */
.ig-footer-security { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; text-align: center; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 25px; padding-bottom: 10px; margin-top: auto; }
.ig-sec-icon { margin-bottom: 10px; }
.ig-footer-security a { color: #f5f5f5; font-size: 13px; font-weight: 500; text-decoration: underline; margin-bottom: 8px; }
.ig-footer-security p { color: #8e9db0; font-size: 11px; line-height: 1.5; max-width: 95%; }
#toast-container {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  width: 90%;
  max-width: 380px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card2);
  color: var(--text-main);
  padding: 16px 20px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-left: 4px solid var(--accent);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  pointer-events: auto;
  transform: translateY(100px);
  opacity: 0;
  animation: slideUpToast 0.4s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.info { border-left-color: var(--accent); }

.toast-icon {
  font-size: 16px;
  margin-top: 2px;
}

.toast.hide {
  animation: slideDownToast 0.3s forwards ease-in;
}

@keyframes slideUpToast {
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDownToast {
  to { transform: translateY(30px); opacity: 0; }
}