/* Design system compartilhado do mockup completo (baseado no layout3 —
   "Vibrante & Acolhedor" — escolhido como direção visual da plataforma). */

:root {
  --bg: #fff9ef;
  --ink: #171412;
  --ink-dim: #6b6259;
  --coral: #ff6b4a;
  --yellow: #ffd23f;
  --teal: #37c6b8;
  --purple: #9a7bfa;
  --pink: #ff8fab;
  --green: #59c26f;
  --card: #ffffff;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Inter", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, .display { font-family: "Fredoka", sans-serif; font-weight: 600; margin: 0; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 32px; }
a { color: inherit; }
img { max-width: 100%; }

.hard { border: 2.5px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.hard-sm { border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }

/* --- nav --- */
.nav { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 2.5px solid var(--ink); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; max-width: 1160px; margin: 0 auto; gap: 24px; }
.logo { font-family: "Fredoka"; font-weight: 700; font-size: 1.3rem; text-decoration: none; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.logo-blob { width: 30px; height: 30px; border-radius: 40% 60% 55% 45% / 55% 45% 60% 40%; background: var(--coral); border: 2px solid var(--ink); flex: none; }
.logo-avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: block; }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; font-size: 0.95rem; font-weight: 600; }
.nav-links a { text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 16px; }
.avatar-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--purple);
  display: flex; align-items: center; justify-content: center; font-family: "Fredoka"; font-weight: 700; color: var(--ink);
  text-decoration: none;
}

/* --- menu de usuário (avatar com dropdown) --- */
.user-menu { position: relative; }
.user-menu-trigger {
  position: relative; width: 42px; height: 42px; border-radius: 50%; border: 2.5px solid var(--ink);
  background: var(--purple); display: flex; align-items: center; justify-content: center; padding: 0;
  font-family: "Fredoka"; font-weight: 700; color: var(--ink); cursor: pointer; flex: none;
}
.user-menu-trigger img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.user-menu-trigger .nav-badge { top: -4px; right: -4px; }

.user-menu-panel {
  display: none; position: absolute; top: calc(100% + 12px); right: 0; z-index: 40; min-width: 240px;
  background: var(--card); border: 2.5px solid var(--ink); border-radius: 18px; box-shadow: 6px 6px 0 var(--ink);
  padding: 8px; flex-direction: column; gap: 2px;
}
.user-menu-panel.open { display: flex; }
.user-menu-header { padding: 10px 12px 12px; border-bottom: 2px dashed var(--ink); margin-bottom: 6px; }
.user-menu-header strong { display: block; font-size: 0.92rem; }
.user-menu-header span { display: block; font-size: 0.76rem; color: var(--ink-dim); font-weight: 500; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-panel a, .user-menu-panel button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: var(--ink); font-family: "Inter"; font-weight: 700; font-size: 0.88rem;
  background: none; border: none; cursor: pointer; position: relative;
}
.user-menu-panel a:hover, .user-menu-panel button:hover { background: var(--bg); }
.user-menu-panel .material-symbols-outlined { font-size: 20px; color: var(--ink-dim); flex: none; }
.user-menu-panel .nav-badge { position: static; margin-left: auto; border: none; }
.user-menu-divider { height: 2px; border-top: 2px dashed var(--ink); margin: 6px 4px; }

.user-menu-hint {
  position: absolute; top: calc(100% + 14px); right: -6px; z-index: 41;
  background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 16px;
  padding: 10px 16px; font-family: "Inter"; font-weight: 700; font-size: 0.82rem; color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink); white-space: nowrap; transform: rotate(-2deg);
  pointer-events: none; animation: hint-pop 0.4s ease-out;
}
.user-menu-hint::before {
  content: ""; position: absolute; top: -11px; right: 24px; width: 0; height: 0;
  border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 12px solid var(--ink);
}
.user-menu-hint::after {
  content: ""; position: absolute; top: -8px; right: 26px; width: 0; height: 0;
  border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 10px solid var(--yellow);
}
@keyframes hint-pop {
  0% { opacity: 0; transform: rotate(-2deg) translateY(-6px); }
  60% { opacity: 1; transform: rotate(-2deg) translateY(2px); }
  100% { opacity: 1; transform: rotate(-2deg) translateY(0); }
}
@media (max-width: 640px) {
  .user-menu-hint { right: -10px; font-size: 0.76rem; padding: 8px 12px; }
}

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 12px 22px;
  font-family: "Inter"; font-weight: 700; font-size: 0.92rem; cursor: pointer; text-decoration: none;
  border: 2.5px solid var(--ink); transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary { background: var(--coral); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn-ghost { background: var(--card); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn-ghost:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none !important; box-shadow: 4px 4px 0 var(--ink) !important; }
.link-plain { text-decoration: none; font-weight: 700; font-size: 0.92rem; }

/* --- misc atoms --- */
.pill { border: 2px solid var(--ink); border-radius: 999px; padding: 9px 18px; font-size: 0.88rem; font-weight: 700; background: var(--card); display: inline-block; }
.eyebrow { display: inline-block; background: var(--ink); color: var(--bg); font-size: 0.75rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; }
.stat-chip { background: var(--card); border-radius: 14px; padding: 12px 18px; font-size: 0.85rem; font-weight: 700; }
.stat-chip b { font-family: "Fredoka"; font-size: 1.1rem; display: block; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.badge-teal { background: rgba(55,198,184,0.18); color: #1f7a70; }
.badge-coral { background: rgba(255,107,74,0.16); color: #b5461f; }
.badge-green { background: rgba(89,194,111,0.2); color: #2c7a3d; }

.verify-free-badge {
  display: inline-block; background: var(--green); color: var(--ink); font-weight: 800;
  padding: 2px 10px; border-radius: 999px; border: 2px solid var(--ink);
  animation: free-badge-pulse 1.6s ease-in-out infinite;
}
@keyframes free-badge-pulse {
  0%, 100% { transform: scale(1) rotate(-1deg); }
  50% { transform: scale(1.08) rotate(1deg); }
}
@media (prefers-reduced-motion: reduce) {
  .verify-free-badge { animation: none; }
}
.hint, .hint-sm { color: var(--ink-dim); font-size: 0.85rem; font-weight: 500; }

/* --- section heading --- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 32px; gap: 24px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.9rem; }
.section-head p { color: var(--ink-dim); max-width: 40ch; margin: 8px 0 0; font-weight: 500; }

/* --- catalog course card (usado no dashboard/relacionados) --- */
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.course-card {
  background: var(--card); border-radius: 22px; padding: 22px; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 12px; transition: transform 0.15s, box-shadow 0.15s;
}
.course-card:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ink); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.card-icon { width: 48px; height: 48px; border-radius: 14px; border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.card-icon .material-symbols-outlined { font-size: 24px; color: var(--ink); }
.card-price { font-family: "Fredoka"; font-weight: 600; background: var(--yellow); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px; font-size: 0.82rem; }
.card-price.free { background: var(--green); }
.course-card h3 { font-size: 1.08rem; line-height: 1.3; }
.card-sub { font-size: 0.8rem; color: var(--ink-dim); font-weight: 600; }
.card-meta { display: flex; gap: 12px; font-size: 0.78rem; font-weight: 700; border-top: 2px dashed var(--ink); padding-top: 12px; }
.card-meta .material-symbols-outlined { font-size: 16px; vertical-align: -3px; }

/* --- progress bar --- */
.progress-track { background: #f1ece0; border: 2px solid var(--ink); border-radius: 999px; height: 14px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--teal); border-right: 2px solid var(--ink); }

footer { border-top: 2.5px solid var(--ink); padding: 40px 0; font-size: 0.85rem; font-weight: 600; }
footer a { color: inherit; text-decoration: none; }
footer a:hover { text-decoration: underline; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.heart { display: inline-block; color: var(--coral); animation: heartbeat 1.6s ease-in-out infinite; }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 25% { transform: scale(1.25); } 40% { transform: scale(1); } }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .nav-inner { padding: 14px 18px; gap: 10px; }
  .nav-actions { justify-content: flex-end; gap: 10px; flex: none; }
  .logo { font-size: 1.12rem; gap: 8px; }
  .logo-blob { width: 24px; height: 24px; }
  .logo-avatar { width: 28px; height: 28px; }
  .btn { padding: 10px 16px; font-size: 0.85rem; }
  .section-head { margin-bottom: 24px; }
  .section-head h2 { font-size: 1.5rem; }
}
@media (max-width: 600px) {
  .course-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .hide-narrow { display: none; }
}
