/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Nunito', system-ui, sans-serif; background: #FFF9F0; }
button { font-family: inherit; cursor: pointer; }
a { text-decoration: none; color: inherit; }

/* Utility classes */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Auth Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(61, 46, 31, 0.4);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease-out;
}
.modal-content {
  background: #FFFDFB; border-radius: 24px;
  padding: 32px; width: 90%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(61, 46, 31, 0.15);
  animation: slideUp 0.3s ease-out;
}
.auth-input {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  border: 1.5px solid #E8DDD0; background: #FFF9F0;
  font-family: 'Nunito', sans-serif; font-size: 15px;
  color: #3D2E1F; outline: none; transition: border-color 0.2s;
}
.auth-input:focus { border-color: #2D9F5D; }
.auth-input::placeholder { color: #8B7355; }

.btn-primary {
  width: 100%; padding: 14px; border-radius: 100px;
  background: #2D9F5D; color: white; border: none;
  font-family: 'Nunito', sans-serif; font-weight: 800;
  font-size: 16px; cursor: pointer; transition: background 0.2s;
}
.btn-primary:hover { background: #1E7A42; }
.btn-primary:disabled { background: #A8DBC0; cursor: not-allowed; }

.btn-google {
  width: 100%; padding: 14px; border-radius: 100px;
  background: white; color: #3D2E1F; border: 1.5px solid #E8DDD0;
  font-family: 'Nunito', sans-serif; font-weight: 700;
  font-size: 15px; cursor: pointer; transition: border-color 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-google:hover { border-color: #8B7355; }

.auth-divider {
  display: flex; align-items: center; gap: 16px;
  margin: 20px 0; color: #8B7355; font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: #E8DDD0;
}

.auth-error {
  background: #FFF0ED; color: #E8634A; border-radius: 10px;
  padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
  border: 1px solid #E8634A33;
}

.auth-link {
  color: #2D9F5D; cursor: pointer; font-weight: 700;
}
.auth-link:hover { text-decoration: underline; }

/* Progress Ring */
.progress-ring-bg { stroke: #F5EDE3; }
.progress-ring-fill {
  stroke: #2D9F5D; transition: stroke-dashoffset 0.5s ease-out;
  transform: rotate(-90deg); transform-origin: center;
}

/* Progress Bar */
.progress-bar {
  height: 6px; border-radius: 3px; background: #F5EDE3; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 3px; background: #2D9F5D;
  transition: width 0.5s ease-out;
}

/* Track Page */
.module-card {
  background: white; border-radius: 20px; padding: 18px;
  border: 1.5px solid #F5EDE3; cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.module-card:hover {
  border-color: #E8DDD0; box-shadow: 0 4px 20px rgba(61, 46, 31, 0.08);
}
.module-card.completed { border-left: 4px solid #2D9F5D; }
.module-card.in-progress { border-left: 4px solid #E8A317; }
.module-card.locked { opacity: 0.6; cursor: default; }

/* Profile */
.avatar-circle {
  width: 48px; height: 48px; border-radius: 50%;
  background: #2D9F5D; color: white; display: flex;
  align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-weight: 700;
  font-size: 18px; flex-shrink: 0;
}
.avatar-circle.large { width: 80px; height: 80px; font-size: 28px; }
.avatar-circle.small { width: 32px; height: 32px; font-size: 13px; }

/* Achievement Badge */
.achievement-badge {
  background: white; border-radius: 16px; padding: 16px;
  border: 1.5px solid #F5EDE3; text-align: center;
  transition: transform 0.2s;
}
.achievement-badge.earned {
  border-color: #E8A317; background: #FFF6E0;
}
.achievement-badge .badge-icon { font-size: 36px; margin-bottom: 8px; }

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeSlide 0.3s ease-out; }

/* Toast notification */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  background: #3D2E1F; color: white; padding: 14px 24px;
  border-radius: 12px; font-family: 'Nunito', sans-serif;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 20px rgba(61, 46, 31, 0.2);
  animation: slideUp 0.3s ease-out;
}

/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */

/* Mobile nav menu */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
  z-index: 200;
}
.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: #3D2E1F;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.hamburger-btn.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger-btn.open span:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(61, 46, 31, 0.4);
  backdrop-filter: blur(4px);
}
.mobile-nav-overlay.open { display: block; }

.mobile-nav-menu {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: #FFFDFB;
  z-index: 160;
  padding: 80px 24px 24px;
  box-shadow: -4px 0 20px rgba(61, 46, 31, 0.1);
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease-out;
}
.mobile-nav-menu.open {
  display: flex;
  transform: translateX(0);
}

.mobile-nav-menu a,
.mobile-nav-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #3D2E1F;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  min-height: 48px;
  width: 100%;
  transition: background 0.15s;
}
.mobile-nav-menu a:hover,
.mobile-nav-menu button:hover {
  background: #F5EDE3;
}
.mobile-nav-menu .mobile-nav-divider {
  height: 1px;
  background: #F5EDE3;
  margin: 8px 0;
}

/* Desktop nav items — hide on mobile */
.desktop-nav { display: flex; align-items: center; gap: 12px; }

/* ============================================
   TABLET (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
  /* Show hamburger, hide desktop nav */
  .hamburger-btn { display: flex; }
  .desktop-nav { display: none !important; }

  /* Container */
  .container { padding: 0 16px !important; }

  /* Sections */
  section { padding-top: 60px !important; padding-bottom: 60px !important; }

  /* Auth modal */
  .modal-content { padding: 28px 20px; width: 95%; }
  .hide-mobile { display: none !important; }

  /* Cards */
  .module-card { padding: 18px !important; }

  /* Profile avatar flex */
  .profile-header { flex-wrap: wrap !important; }

  /* Beehiiv newsletter iframe */
  iframe.beehiiv-embed {
    width: 100% !important;
    max-width: 100% !important;
    height: 320px !important;
  }
}

/* ============================================
   PHONE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
  /* Container tighter */
  .container { padding: 0 12px !important; }

  /* Smaller sections */
  section { padding-top: 40px !important; padding-bottom: 40px !important; }

  /* Cards more compact */
  .module-card { padding: 14px !important; }

  /* Touch targets */
  button, a[role="button"], [role="button"] {
    min-height: 44px;
  }

  /* Achievement badges tighter */
  .achievement-badge { padding: 14px !important; }
}
