/* ===================================================
   Meno Ativa — components.css
   Componentes reutilizáveis com CSS Custom Properties
   =================================================== */

/* ===================================================
   Botões
   =================================================== */
.btn-primary,
.btn-secondary,
.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary:active,
.btn-secondary:active,
.btn-gold:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--roxo);
  color: #ffffff;
  border-color: var(--roxo);
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-secondary {
  background: transparent;
  color: var(--text1);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg3);
}

.btn-gold {
  background: var(--dourado);
  color: #ffffff;
  border-color: var(--dourado);
}

.btn-gold:hover {
  opacity: 0.88;
}

/* Versão pequena dos botões */
.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 8px;
}

/* Botão desabilitado */
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-gold:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ===================================================
   Cards
   =================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.card-highlighted {
  background: var(--card);
  border: 1.5px solid var(--roxo);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(139, 46, 139, 0.10);
}

/* ===================================================
   Bottom Navigation (mobile)
   =================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 100;
  min-height: 64px;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0 10px;
  cursor: pointer;
  background: none;
  border: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}

.bottom-nav__item:active {
  opacity: 0.7;
}

.bottom-nav__icon {
  font-size: 22px;
  display: block;
  line-height: 1;
}

.bottom-nav__label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  margin-top: 2px;
  font-family: 'DM Sans', sans-serif;
}

.bottom-nav__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--roxo);
  margin: 2px auto 0;
  display: none;
}

/* Estado ativo */
.bottom-nav__item--active .bottom-nav__label {
  color: var(--roxo);
  font-weight: 600;
}

.bottom-nav__item--active .bottom-nav__dot {
  display: block;
}

/* Esconde bottom nav em desktop */
@media (min-width: 768px) {
  .bottom-nav {
    display: none;
  }
}

/* ===================================================
   Sidebar (desktop)
   =================================================== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 220px;
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  z-index: 50;
}

@media (min-width: 768px) {
  .sidebar {
    display: flex;
  }
}

.sidebar__logo {
  padding: 0 20px 24px;
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--roxo);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

.sidebar__item:hover {
  background: var(--bg3);
  color: var(--text1);
}

.sidebar__item--active {
  background: var(--roxo-pale);
  color: var(--roxo);
  font-weight: 600;
}

/* ===================================================
   Streak Badge
   =================================================== */
.streak-badge {
  background: var(--streak-bg);
  border-radius: 12px;
  padding: 8px 12px;
  text-align: center;
  display: inline-block;
}

.streak-badge__number {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: var(--dourado);
  line-height: 1;
  display: block;
}

.streak-badge__label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  letter-spacing: 0.03em;
  display: block;
  margin-top: 2px;
}

/* ===================================================
   Trial Banner
   =================================================== */
.trial-banner {
  background: var(--dourado-pale);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.trial-banner__text {
  font-size: 13px;
  color: var(--dourado);
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  line-height: 1.4;
}

.trial-banner__btn {
  /* herda .btn-sm.btn-gold — aplique ambas as classes no HTML */
  flex-shrink: 0;
}

/* ===================================================
   Barra de Nível
   =================================================== */
.level-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px;
}

.level-bar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.level-bar__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--roxo);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: 'DM Sans', sans-serif;
}

.level-bar__next {
  font-size: 12px;
  color: var(--text3);
  font-family: 'DM Sans', sans-serif;
}

.level-bar__track {
  height: 4px;
  background: var(--roxo-pale);
  border-radius: 2px;
  overflow: hidden;
}

.level-bar__fill {
  height: 100%;
  background: var(--roxo);
  border-radius: 2px;
  transition: width 0.5s ease;
  min-width: 0;
}

/* ===================================================
   Toggle de Dark Mode
   =================================================== */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle__label {
  font-size: 14px;
  color: var(--text2);
  font-family: 'DM Sans', sans-serif;
  user-select: none;
}

.theme-toggle__pill {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.theme-toggle__pill--active {
  background: var(--roxo);
}

.theme-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: left 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.theme-toggle__pill--active .theme-toggle__thumb {
  left: 23px;
}

/* ===================================================
   Form Inputs
   =================================================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
  display: block;
  margin-bottom: 6px;
  font-family: 'DM Sans', sans-serif;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg2);
  color: var(--text1);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  transition: border-color 0.15s;
  appearance: none;
}

.form-input::placeholder {
  color: var(--text3);
}

.form-input:focus {
  outline: none;
  border-color: var(--roxo);
}

.form-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Select */
select.form-input {
  cursor: pointer;
}

/* ===================================================
   Loading / Spinner
   =================================================== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--roxo);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

/* Spinner grande, centralizado na tela */
.spinner-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3.5px;
}

/* ===================================================
   Conquistas / Achievement Badges
   =================================================== */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.achievement-badge {
  text-align: center;
  padding: 12px 8px;
  border-radius: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  transition: opacity 0.2s;
}

.achievement-badge--locked {
  opacity: 0.4;
}

.achievement-badge--unlocked {
  border-color: var(--dourado);
  background: var(--dourado-pale);
  opacity: 1;
}

.achievement-badge__emoji {
  font-size: 28px;
  display: block;
  margin-bottom: 4px;
  line-height: 1.1;
}

.achievement-badge__name {
  font-size: 10px;
  color: var(--text3);
  line-height: 1.2;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
}

/* ===================================================
   Tela de Onboarding
   =================================================== */
.onboarding-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  background: var(--bg);
}

.onboarding-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 32px;
}

.onboarding-progress__dot {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.3s;
}

.onboarding-progress__dot--active {
  background: var(--roxo);
}

.onboarding-question {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  color: var(--text1);
  margin-bottom: 32px;
  margin-top: 0;
  line-height: 1.3;
}

/* ===================================================
   Opções de Escolha Múltipla (Onboarding)
   =================================================== */
.choice-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-option {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.choice-option:hover {
  border-color: var(--roxo-light);
}

.choice-option--selected {
  border-color: var(--roxo);
  background: var(--roxo-pale);
}

.choice-option__emoji {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
}

.choice-option__text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text1);
  font-family: 'DM Sans', sans-serif;
  line-height: 1.3;
}
