/* =========================================================
   PyDebug — Global Styles
   Theme: dark IDE / terminal aesthetic (fits a Python debugging tool)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Color tokens */
  --bg-primary: #0b0e14;
  --bg-surface: #131722;
  --bg-elevated: #1b202c;
  --border-subtle: #262c3b;

  --text-primary: #e6e8ef;
  --text-muted: #8b93a7;

  --accent-mint: #4fd1c5;
  --accent-mint-dim: #2f7d76;
  --accent-amber: #e3b341;
  --accent-red: #f2545b;
  --accent-green: #3fb950;

  /* Type */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  scroll-behavior: smooth;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }
p { line-height: 1.6; color: var(--text-muted); }
code, pre { font-family: var(--font-mono); }

/* ---------- Layout shell ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar__logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-mint);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
}
.sidebar__logo::before {
  content: ">_";
  color: var(--accent-amber);
}

.sidebar__section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0 10px;
  margin: 18px 0 8px;
}
.sidebar__section-label:first-of-type { margin-top: 0; }

.sidebar nav { display: flex; flex-direction: column; }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 2px;
  border-left: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sidebar nav a .nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.nav-icon svg, .sidebar__logout-btn svg, .mobile-menu-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}
.mobile-menu-btn svg { width: 20px; height: 20px; }
.sidebar nav a:hover { background: var(--bg-elevated); color: var(--text-primary); }
.sidebar nav a.active {
  background: rgba(79, 209, 197, 0.12);
  color: var(--accent-mint);
  font-weight: 500;
  border-left-color: var(--accent-mint);
}

/* Account block pinned to the bottom of the sidebar */
.sidebar__account {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-mint-dim);
  color: #eafffb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.sidebar__account-info { flex: 1; min-width: 0; }
.sidebar__account-info .name {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar__account-info .plan { font-size: 0.72rem; color: var(--text-muted); }
.sidebar__logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.sidebar__logout-btn:hover { background: var(--bg-elevated); color: var(--accent-red); }

.sidebar__login-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: var(--text-primary);
}
.sidebar__login-link:hover .sidebar__avatar { background: var(--accent-mint); color: #08141a; }
.sidebar__login-link .name { color: var(--accent-mint); font-weight: 600; }

/* Mobile menu button + overlay — hidden on desktop, shown via responsive.css */
.mobile-menu-btn { display: none; }
.sidebar-overlay { display: none; }

.main-content {
  flex: 1;
  padding: 32px 40px;
  max-width: 1200px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn--primary { background: var(--accent-mint); color: #08141a; }
.btn--primary:hover { opacity: 0.9; }

.btn--secondary { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-subtle); }
.btn--secondary:hover { border-color: var(--accent-mint); }

.btn--full { width: 100%; justify-content: center; }

/* ---------- Cards / forms (auth pages) ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(79,209,197,0.08), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(227,179,65,0.06), transparent 40%),
    var(--bg-primary);
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
.auth-card h1 { font-size: 1.4rem; margin-bottom: 4px; }
.auth-card .subtitle { margin-bottom: 24px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field input, .field textarea, select {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.92rem;
}
.field input:focus, .field textarea:focus, select:focus {
  outline: 2px solid var(--accent-mint);
  outline-offset: 1px;
  border-color: transparent;
}

.password-field { position: relative; display: flex; align-items: center; }
.password-field input { padding-right: 64px; }
.password-toggle-btn {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: var(--accent-mint);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
}
.password-toggle-btn:hover { text-decoration: underline; }

.auth-switch { margin-top: 18px; text-align: center; color: var(--text-muted); font-size: 0.88rem; }
.auth-switch a { color: var(--accent-mint); font-weight: 500; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.btn--google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid var(--border-subtle);
}
.btn--google:hover { background: #f5f5f5; }

/* ---------- Tags / badges ---------- */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tag--bug { background: rgba(242, 84, 91, 0.15); color: var(--accent-red); }
.tag--question { background: rgba(79, 209, 197, 0.15); color: var(--accent-mint); }
.tag--free { background: rgba(63, 185, 80, 0.15); color: var(--accent-green); }
.tag--premium { background: rgba(227, 179, 65, 0.18); color: var(--accent-amber); }

.badge--premium {
  background: var(--accent-amber);
  color: #2a1e04;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.diff { font-size: 0.78rem; font-weight: 600; text-transform: capitalize; }
.diff--easy { color: var(--accent-green); }
.diff--medium { color: var(--accent-amber); }
.diff--hard { color: var(--accent-red); }

/* ---------- Toast ---------- */
.app-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s;
  z-index: 999;
}
.app-toast.show { opacity: 1; transform: translateY(0); }
.app-toast--success { border-color: var(--accent-green); }
.app-toast--error { border-color: var(--accent-red); }

/* ---------- Landing page ---------- */
.landing-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  background:
    radial-gradient(circle at 15% 15%, rgba(79,209,197,0.10), transparent 45%),
    radial-gradient(circle at 85% 25%, rgba(227,179,65,0.08), transparent 40%),
    var(--bg-primary);
}
.landing-hero__eyebrow {
  font-family: var(--font-mono);
  color: var(--accent-mint);
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.landing-hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  max-width: 800px;
  margin-bottom: 16px;
}
.landing-hero p.lead {
  max-width: 560px;
  font-size: 1.05rem;
  margin-bottom: 32px;
}

.landing-cta { display: flex; gap: 14px; }
.landing-cta--single { justify-content: center; }
.btn--hero { padding: 16px 32px; font-size: 1.05rem; border-radius: var(--radius-md); }
.landing-cta__secondary {
  display: block;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.landing-cta__secondary:hover { color: var(--accent-mint); }

.landing-terminal {
  margin-top: 56px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: left;
  max-width: 520px;
  width: 100%;
}
.landing-terminal .line-error { color: var(--accent-red); }
.landing-terminal .cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent-mint);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 64px auto 0;
  padding: 0 20px;
}
.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  text-align: left;
}
.feature-card .icon { font-size: 1.4rem; margin-bottom: 10px; }

/* Daily habit + premium teaser sections on the landing page */
.habit-section {
  padding: 60px 20px;
  margin-top: 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.habit-section__inner { max-width: 640px; margin: 0 auto; text-align: center; }
.habit-section h2 { font-size: 1.6rem; margin-bottom: 14px; }
.habit-section p { margin-bottom: 28px; }
.habit-stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  font-size: 0.92rem;
  color: var(--text-primary);
}
.habit-stats div { display: flex; align-items: center; gap: 8px; }

.premium-teaser {
  padding: 56px 20px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(227,179,65,0.08), transparent 50%),
    var(--bg-primary);
}
.premium-teaser__inner { max-width: 520px; margin: 0 auto; }
.premium-teaser h2 { font-size: 1.5rem; margin-bottom: 10px; color: var(--accent-amber); }
.premium-teaser p { margin-bottom: 24px; }
