/* =========================================================
   🎯 HÁBITOS DE ESTUDO — dashboard + modal Flash
========================================================= */

.study-habits-card {
  margin: 0;
  padding: 16px 18px;
  border-radius: 18px;
  background:
    radial-gradient(520px 180px at 0% 0%, rgba(99, 102, 241, 0.12), transparent 60%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid rgba(99, 102, 241, 0.18);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.study-habits-card--modal {
  box-shadow: none;
  border: none;
  background: transparent;
  padding: 0 0 4px;
}

.study-rhythm-modal {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  pointer-events: none;
}

.study-rhythm-modal[hidden] {
  display: none !important;
}

.study-rhythm-modal.is-open {
  pointer-events: auto;
}

.study-rhythm-modal-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(15, 23, 42, 0.5);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.study-rhythm-modal.is-open .study-rhythm-modal-backdrop {
  opacity: 1;
}

.study-rhythm-modal-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  max-height: min(88vh, 520px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-radius: 20px 20px 0 0;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.18);
  transform: translateY(105%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.study-rhythm-modal.is-open .study-rhythm-modal-sheet {
  transform: translateY(0);
}

.study-rhythm-modal-grab {
  width: 40px;
  height: 4px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: #cbd5e1;
}

.study-rhythm-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.study-rhythm-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #334155;
}

.study-rhythm-modal-close {
  border: none;
  background: #f1f5f9;
  color: #64748b;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}

body.study-rhythm-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}

@media (min-width: 641px) {
  .study-rhythm-modal {
    align-items: center;
    padding: 20px;
  }

  .study-rhythm-modal-sheet {
    border-radius: 20px;
    padding: 14px 18px 18px;
    max-height: min(85vh, 520px);
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    transition:
      transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.22s ease;
  }

  .study-rhythm-modal.is-open .study-rhythm-modal-sheet {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  .study-rhythm-modal-grab {
    display: none;
  }
}

.study-habits-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.study-habits-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6366f1;
}

.study-habits-stats {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  line-height: 1.4;
}

.study-streak-chip {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.25);
  color: #c2410c;
  font-size: 12px;
  font-weight: 800;
}

.study-habits-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.study-daily-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

#studyDailyFill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #22c55e);
  transition: width 0.35s ease;
}

#studyDailyLabel {
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

.study-habits-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.study-habits-actions--flash {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.study-habits-btn {
  min-height: 44px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.study-habits-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.study-habits-btn--blitz {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.study-habits-btn--leve {
  background: linear-gradient(135deg, #22c55e, #14b8a6);
}

.study-habits-btn--podcast {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.study-habits-hint {
  margin: 10px 0 0;
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .study-habits-actions,
  .study-habits-actions--flash {
    grid-template-columns: 1fr;
  }
}

/* —— Ritual diário (home) —— */
.daily-ritual {
  margin: 0 0 16px;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.22);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.daily-ritual--done {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(99, 102, 241, 0.06));
}

.daily-ritual-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.daily-ritual-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6366f1;
}

.daily-ritual-streak {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.daily-ritual-review-chip {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.daily-ritual-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.daily-ritual-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.daily-ritual-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width 0.35s ease;
}

.daily-ritual--done .daily-ritual-fill {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.daily-ritual-count {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  min-width: 2.5rem;
  text-align: right;
}

.daily-ritual-hint {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
}

.daily-ritual-exam {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.4;
  color: #475569;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.daily-ritual-cta {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.daily-ritual-cta:active {
  transform: scale(0.98);
}

.pv-streak-top-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow: visible;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #c2410c;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.pv-streak-top-btn:hover {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.18);
}

.pv-streak-top-btn .dash-streak-icon {
  font-size: 15px;
  line-height: 1;
}

.pv-streak-top-btn .dash-streak-label {
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .daily-ritual {
    padding: 14px;
  }
}
