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

:root {
  /* Identidade TWE Educação */
  --marca: #00e89d;
  --marca-hover: #00cc88;
  --marca-esc: #077256;
  --grad-de: #077256;
  --grad-meio: #109875;
  --grad-ate: #10c59a;

  /* Fases da respiração (indicadores funcionais) */
  --inspirar: #10c59a;
  --segurar: #ffd54f;
  --soltar: #00e89d;

  /* Superfícies (tema escuro da marca) */
  --fundo: #0d0d0d;
  --fundo-alt: #151515;
  --superficie: #2d2d2d;
  --borda: #333333;
  --texto: #ffffff;
  --texto-sec: #b0b0b0;

  --raio-card: 14px;
  --raio-botao: 8px;
}

body {
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at 50% 20%, #12241d 0%, var(--fundo) 70%);
  color: var(--texto);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

h1, h2, .login-titulo, .fase {
  font-family: "Montserrat", "Inter", -apple-system, "Segoe UI", sans-serif;
}

.app {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.marca-topo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.marca-logo {
  width: 34px;
  height: auto;
}

.topo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.subtitulo {
  margin-top: 6px;
  font-size: 0.95rem;
  color: var(--texto-sec);
}

/* Círculo central */
.circulo-area {
  margin: 36px 0 28px;
}

.circulo {
  width: 220px;
  height: 220px;
  margin: 0 auto;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 3px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 60px rgba(16, 197, 154, 0);
  transition: transform 0.4s ease, border-color 0.6s ease,
    box-shadow 0.6s ease, background 0.6s ease;
}

.circulo.inspirar {
  border-color: var(--inspirar);
  box-shadow: 0 0 70px rgba(16, 197, 154, 0.45);
  transform: scale(1.12);
}

.circulo.segurar {
  border-color: var(--segurar);
  box-shadow: 0 0 70px rgba(255, 213, 79, 0.4);
  transform: scale(1.12);
}

.circulo.soltar {
  border-color: var(--soltar);
  box-shadow: 0 0 70px rgba(0, 232, 157, 0.45);
  transform: scale(0.9);
}

.fase {
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.contador {
  font-size: 3.4rem;
  font-weight: 300;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* Barra de respiração */
.barra-area {
  margin: 8px 0 28px;
}

.barra-trilho {
  width: 100%;
  height: 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
}

.barra-preenchimento {
  height: 100%;
  width: 0%;
  border-radius: 20px;
  background: var(--inspirar);
  transition: background 0.5s ease;
}

.instrucao {
  margin-top: 12px;
  font-size: 1rem;
  opacity: 0.8;
  min-height: 1.4em;
}

/* Controles */
.controles {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}

.botao {
  flex: 1;
  max-width: 160px;
  padding: 14px 20px;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: var(--raio-botao);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease, filter 0.2s ease;
}

.botao:active {
  transform: scale(0.96);
}

.botao:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.primario {
  background: linear-gradient(135deg, var(--grad-de), var(--grad-ate));
  color: #052b21;
}

.primario:hover:not(:disabled) {
  filter: brightness(1.08);
}

.secundario {
  background: rgba(255, 255, 255, 0.1);
  color: var(--texto);
}

/* Configurações */
.config {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 0.95rem;
  opacity: 0.85;
  margin-bottom: 24px;
}

.config label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.config select {
  background: rgba(255, 255, 255, 0.1);
  color: var(--texto);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.95rem;
}

.config input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--inspirar);
}

.rodape {
  font-size: 0.9rem;
  opacity: 0.55;
}

/* ===== Login ===== */
.tela-login {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-card {
  background: var(--fundo-alt);
  border: 1px solid var(--borda);
  border-radius: var(--raio-card);
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-logo {
  width: 84px;
  height: auto;
  margin: 0 auto 4px;
  display: block;
}

.login-titulo {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-align: center;
}

.login-sub {
  font-size: 0.95rem;
  opacity: 0.65;
  text-align: center;
  margin-top: -8px;
}

.campo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  font-size: 0.9rem;
}

.campo span {
  opacity: 0.8;
  padding-left: 4px;
}

.campo input {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--texto);
  font-size: 1rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.campo input:focus {
  outline: none;
  border-color: var(--inspirar);
  background: rgba(255, 255, 255, 0.1);
}

.campo input:disabled {
  opacity: 0.5;
}

.botao.largo {
  max-width: none;
  width: 100%;
  margin-top: 4px;
}

.botao-instalar {
  background: transparent;
  color: var(--marca);
  border: 1px solid var(--marca);
  border-radius: var(--raio-botao);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.botao-instalar:hover {
  background: var(--marca);
  color: #052b21;
}

.login-erro {
  background: rgba(239, 83, 80, 0.15);
  border: 1px solid rgba(239, 83, 80, 0.4);
  color: #ffb4b0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  text-align: center;
}

.lista-empresas {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empresa-item {
  text-align: center;
}

/* Barra de conta no topo do app */
.conta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  font-size: 0.9rem;
}

.aluno-nome {
  opacity: 0.8;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.botao-sair {
  background: rgba(255, 255, 255, 0.08);
  color: var(--texto);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.botao-sair:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Verificando acesso */
.spinner {
  width: 42px;
  height: 42px;
  margin: 4px auto;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--inspirar);
  border-radius: 50%;
  animation: girar 0.8s linear infinite;
}

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

/* Sem acesso */
.icone-bloqueio {
  font-size: 2.6rem;
  text-align: center;
}

/* Link estilizado como botão (CTA de compra) */
a.botao {
  display: block;
  text-align: center;
  text-decoration: none;
  line-height: 1.2;
}

.botao-sair-largo {
  width: 100%;
  padding: 12px 20px;
  margin-top: 2px;
}

/* Toast "+1 ponto no ranking" */
.ranking-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--grad-de), var(--grad-ate));
  color: #052b21;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 232, 157, 0.4);
  z-index: 50;
  pointer-events: none;
}

.ranking-toast-mais {
  font-size: 1.3rem;
  font-weight: 800;
}

.ranking-toast-txt {
  font-size: 0.95rem;
  opacity: 0.95;
}

.ranking-toast.anim {
  animation: pontoGanho 2.8s ease forwards;
}

@keyframes pontoGanho {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-16px) scale(0.8); }
  12%  { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.06); }
  22%  { transform: translateX(-50%) translateY(0) scale(1); }
  80%  { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(0.96); }
}

[hidden] {
  display: none !important;
}
