/* ============================================
   LUBRA DECISOR FINANCEIRO V2 — DESIGN SYSTEM
   Baseado 100% na V1. Não alterar variáveis.
   ============================================ */

:root {
  --azul-escuro:   #0c2d5a;
  --azul-medio:    #163a70;
  --dourado:       #c8a243;
  --dourado-hover: #b89335;
  --verde:         #2ca56d;
  --amarelo:       #e6a700;
  --vermelho:      #d9534f;
  --fundo:         #eef1f6;
  --card:          #ffffff;
}

/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: var(--fundo);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

a {
  color: var(--dourado);
  text-decoration: none;
}

a:hover {
  color: var(--dourado-hover);
  text-decoration: underline;
}

/* === CONTAINER CARD CENTRAL (padrão app/auth) === */
.container {
  background: var(--card);
  margin: 30px auto;
  padding: 30px;
  border-radius: 20px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  text-align: center;
}

/* === LOGO === */
.logo {
  width: 230px;
  max-width: 85%;
  height: auto;
  margin-bottom: 18px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

/* === TIPOGRAFIA === */
h1 {
  margin: 0;
  color: var(--azul-escuro);
  font-size: 22px;
}

h2 {
  color: var(--azul-escuro);
  font-size: 18px;
  margin: 0 0 16px 0;
}

.headline {
  margin-top: 8px;
  margin-bottom: 25px;
}

.headline p:first-child {
  font-weight: bold;
  color: var(--azul-escuro);
  font-size: 18px;
  margin: 0;
}

.headline p:last-child {
  color: var(--dourado);
  font-weight: bold;
  margin: 3px 0 0 0;
}

.subtitulo {
  color: var(--azul-escuro);
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 15px;
  margin-top: 0;
}

/* === FORMULÁRIOS === */
input, select, textarea {
  width: 100%;
  padding: 12px;
  margin: 7px 0;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 16px;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--azul-medio);
}

label {
  display: block;
  text-align: left;
  font-size: 14px;
  font-weight: bold;
  color: var(--azul-medio);
  margin-top: 8px;
  margin-bottom: 2px;
}

/* === BOTÕES === */
button, .btn {
  display: block;
  width: 100%;
  background: var(--dourado);
  border: none;
  color: white;
  padding: 15px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
  font-weight: bold;
  font-family: Arial, sans-serif;
  transition: background 0.2s;
  text-align: center;
}

button:hover, .btn:hover {
  background: var(--dourado-hover);
}

button:disabled, .btn:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.btn-secundario {
  background: var(--azul-escuro);
}

.btn-secundario:hover {
  background: var(--azul-medio);
}

.btn-pdf {
  background: var(--azul-escuro);
  margin-top: 15px;
}

.btn-pdf:hover {
  background: var(--azul-medio);
}

.btn-limpar {
  background: var(--vermelho);
  margin-top: 20px;
}

.btn-limpar:hover {
  background: #c9302c;
}

.btn-link {
  background: none;
  border: none;
  color: var(--dourado);
  font-size: 14px;
  padding: 8px 0;
  cursor: pointer;
  font-weight: bold;
  width: auto;
  text-decoration: underline;
  margin-top: 4px;
}

/* === MENSAGENS DE FEEDBACK === */
.msg {
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  display: none;
}

.msg.erro {
  background: #fdecea;
  color: var(--vermelho);
  border: 1px solid var(--vermelho);
  display: block;
}

.msg.sucesso {
  background: #e8f8f1;
  color: var(--verde);
  border: 1px solid var(--verde);
  display: block;
}

.msg.info {
  background: #eef1f6;
  color: var(--azul-medio);
  border: 1px solid #b0bdd4;
  display: block;
}

/* === STATUS DE DIAGNÓSTICO === */
.result {
  margin-top: 25px;
  text-align: left;
  font-size: 18px;
  color: var(--azul-medio);
}

.status {
  margin-top: 20px;
  padding: 18px;
  border-radius: 14px;
  color: white;
  font-weight: bold;
  text-align: center;
  font-size: 18px;
}

.green  { background: var(--verde); }
.yellow { background: var(--amarelo); }
.red    { background: var(--vermelho); }

.limite {
  margin-top: 15px;
  background: #f4f7fb;
  padding: 15px;
  border-left: 6px solid var(--verde);
  border-radius: 10px;
  font-weight: bold;
  color: var(--azul-medio);
}

/* === TABS === */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--azul-escuro);
}

.tabs .tab {
  flex: 1;
  background: var(--azul-escuro);
  color: white;
  border: none;
  padding: 12px 6px;
  font-size: 12px;
  cursor: pointer;
  font-weight: bold;
  margin: 0;
  border-radius: 0;
  width: auto;
}

.tabs .tab.active {
  background: var(--dourado);
  color: white;
}

.tabs .tab:hover:not(.active) {
  background: var(--azul-medio);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* === SCORE LUBRA === */
.score-container {
  margin-top: 20px;
  text-align: center;
  padding: 15px;
  background: #f4f7fb;
  border-radius: 14px;
}

.score-label {
  font-weight: bold;
  color: var(--azul-escuro);
  font-size: 16px;
  margin: 0 0 10px 0;
}

.score-bar-bg {
  background: #ddd;
  border-radius: 10px;
  height: 20px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.5s ease;
}

.score-value {
  font-size: 28px;
  font-weight: bold;
  margin: 10px 0 5px 0;
}

.score-faixa {
  font-size: 14px;
  font-weight: bold;
  margin: 0;
  color: var(--azul-medio);
}

.score-explicacao {
  text-align: left;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
  font-size: 14px;
  color: var(--azul-medio);
  line-height: 1.5;
}

.score-explicacao p {
  margin: 0 0 8px 0;
}

.score-dicas-titulo {
  font-weight: bold;
  color: var(--azul-escuro);
  margin-top: 10px !important;
}

.score-dicas {
  margin: 5px 0 0 0;
  padding-left: 20px;
}

.score-dicas li {
  margin-bottom: 6px;
}

/* === HISTÓRICO === */
.hist-item {
  background: #f4f7fb;
  border-radius: 10px;
  padding: 12px 15px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-left: 5px solid #ccc;
  text-align: left;
}

.hist-item:hover { background: #e8ecf3; }
.hist-item.hist-green  { border-left-color: var(--verde); }
.hist-item.hist-yellow { border-left-color: var(--amarelo); }
.hist-item.hist-red    { border-left-color: var(--vermelho); }

.hist-item-info {
  font-size: 14px;
  color: var(--azul-medio);
}

.hist-item-score {
  font-weight: bold;
  font-size: 20px;
  min-width: 50px;
  text-align: center;
}

.hist-empty {
  text-align: center;
  color: #999;
  padding: 30px 0;
  font-size: 16px;
}

/* === MODAL === */
.hist-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.hist-modal {
  background: white;
  padding: 25px;
  border-radius: 20px;
  width: 380px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  text-align: left;
  color: var(--azul-medio);
}

/* === LOADING SPINNER === */
.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #ddd;
  border-top-color: var(--dourado);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === TELA DE LOADING INICIAL (auth guard) === */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--fundo);
}

/* === QR CODE PIX === */
.qr-container {
  background: #f4f7fb;
  border-radius: 14px;
  padding: 20px;
  margin-top: 20px;
  text-align: center;
}

.qr-container img {
  width: 200px;
  height: 200px;
  border-radius: 10px;
  border: 4px solid var(--azul-escuro);
}

.pix-copia-cola {
  background: white;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 11px;
  word-break: break-all;
  color: var(--azul-medio);
  margin-top: 12px;
  text-align: left;
  font-family: monospace;
}

.btn-copiar {
  margin-top: 10px;
  padding: 10px;
  font-size: 14px;
}

/* === PLANOS (index + pagamento) === */
.planos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 40px 0;
}

.plano-card {
  background: var(--card);
  border-radius: 20px;
  padding: 28px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
  border: 3px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
  cursor: pointer;
}

.plano-card:hover,
.plano-card.selecionado {
  border-color: var(--dourado);
  transform: translateY(-4px);
}

.plano-card.destaque {
  border-color: var(--azul-escuro);
}

.plano-nome {
  font-size: 20px;
  font-weight: bold;
  color: var(--azul-escuro);
  margin: 0 0 6px 0;
}

.plano-duracao {
  font-size: 14px;
  color: #666;
  margin: 0 0 16px 0;
}

.plano-preco {
  font-size: 32px;
  font-weight: bold;
  color: var(--dourado);
  margin: 0;
}

.plano-preco span {
  font-size: 16px;
  color: #999;
  font-weight: normal;
}

.badge-popular {
  display: inline-block;
  background: var(--dourado);
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

/* === LANDING PAGE HERO === */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
  max-width: 700px;
  margin: 0 auto;
}

.hero .logo {
  width: 200px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 32px;
  color: var(--azul-escuro);
  margin: 0 0 10px 0;
  line-height: 1.2;
}

.hero h1 span {
  color: var(--dourado);
}

.hero p {
  font-size: 18px;
  color: var(--azul-medio);
  margin: 0 0 32px 0;
  line-height: 1.6;
}

.hero .btn {
  display: inline-block;
  width: auto;
  padding: 16px 40px;
  font-size: 18px;
  border-radius: 12px;
  text-decoration: none;
}

/* === BENEFÍCIOS === */
.beneficios {
  max-width: 700px;
  margin: 0 auto 60px;
  padding: 0 20px;
}

.beneficios h2 {
  text-align: center;
  color: var(--azul-escuro);
  font-size: 24px;
  margin-bottom: 30px;
}

.beneficio-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.beneficio-icone {
  font-size: 28px;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.beneficio-texto h3 {
  margin: 0 0 4px 0;
  color: var(--azul-escuro);
  font-size: 16px;
}

.beneficio-texto p {
  margin: 0;
  color: #555;
  font-size: 14px;
  line-height: 1.5;
}

/* === SEÇÃO PLANOS NA LANDING === */
.secao-planos {
  background: var(--azul-escuro);
  padding: 60px 20px;
}

.secao-planos h2 {
  text-align: center;
  color: white;
  font-size: 26px;
  margin: 0 0 40px 0;
}

.secao-planos .planos-grid {
  max-width: 860px;
  margin: 0 auto 0;
}

.secao-planos .plano-card {
  background: white;
}

/* === FOOTER === */
footer {
  text-align: center;
  padding: 30px 20px;
  color: #999;
  font-size: 13px;
}

/* === TELA BLOQUEADO === */
.bloqueado-container {
  max-width: 460px;
  margin: 60px auto;
  padding: 40px 30px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  text-align: center;
}

.bloqueado-icone {
  font-size: 64px;
  margin-bottom: 16px;
}

/* === BARRA DE PROGRESSO AGUARDANDO === */
.progresso-bar {
  width: 100%;
  height: 6px;
  background: #ddd;
  border-radius: 10px;
  overflow: hidden;
  margin: 20px 0;
}

.progresso-fill {
  height: 100%;
  background: var(--dourado);
  border-radius: 10px;
  animation: progresso 3s ease-in-out infinite;
}

@keyframes progresso {
  0%   { width: 0%; }
  50%  { width: 70%; }
  100% { width: 100%; }
}

/* === RESPONSIVIDADE === */
@media (max-width: 480px) {
  .container {
    margin: 16px;
    padding: 24px 18px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .hero p {
    font-size: 16px;
  }

  .planos-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .plano-card {
    padding: 20px 14px;
  }

  .plano-preco {
    font-size: 26px;
  }

  .secao-planos {
    padding: 40px 14px;
  }

  .hist-modal {
    width: 95vw;
    padding: 18px;
  }
}

@media (max-width: 360px) {
  .planos-grid {
    grid-template-columns: 1fr;
  }
}
