@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --surface-2: #1e1e1e;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --text: #f0ede8;
  --text-muted: #888;
  --text-dim: #555;
  --accent: #c8f060;
  --accent-dark: #9dbf3a;
  --danger: #ff5a5a;
  --radius: 12px;
  --radius-sm: 8px;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(13,13,13,0.85);
  backdrop-filter: blur(12px);
}

.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.nav-logo span { color: var(--accent); }

.nav-links { display: flex; gap: 0.5rem; align-items: center; }

.nav-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.4rem 0.875rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover { color: var(--text); background: var(--surface-2); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #0d0d0d;
}

.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { border-color: var(--border-hover); color: var(--text); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(255,90,90,0.3);
}

.btn-danger:hover { background: rgba(255,90,90,0.08); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* PAGE WRAPPER */
.page {
  display: none;
  min-height: 100vh;
  padding-top: 72px;
}

.page.active { display: block; }

/* HERO */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 1.5rem 6rem;
  max-width: 720px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(200,240,96,0.25);
  padding: 0.3rem 0.875rem;
  border-radius: 999px;
  margin-bottom: 2rem;
}

.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero p {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 480px;
}

.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

/* AUTH PAGES */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 72px);
  padding: 2rem 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
}

.auth-card h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.375rem;
}

.auth-card p.subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

/* FORMS */
.form-group { margin-bottom: 1.125rem; }

.form-group label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 300;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-group select option { background: #1e1e1e; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: rgba(200,240,96,0.4);
}

.form-group input::placeholder { color: var(--text-dim); }
.form-group textarea { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.form-submit { width: 100%; margin-top: 0.5rem; justify-content: center; padding: 0.75rem; font-size: 0.9375rem; }

.form-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.form-footer a { color: var(--accent); }
.form-footer a:hover { text-decoration: underline; }

/* ALERT */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  display: none;
}

.alert.show { display: block; }
.alert-error { background: rgba(255,90,90,0.1); border: 1px solid rgba(255,90,90,0.2); color: #ff8a8a; }
.alert-success { background: rgba(200,240,96,0.08); border: 1px solid rgba(200,240,96,0.2); color: var(--accent); }

/* DASHBOARD */
.dashboard-layout {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.dashboard-header p { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.2rem; }

/* STAT CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.stat-card .stat-value {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-card .stat-sub { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.3rem; }

/* PROGRESS BAR */
.progress-bar-wrap {
  background: var(--surface-2);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* CARDS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.875rem;
}

.card h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.card p { color: var(--text-muted); font-size: 0.9rem; }

.task-card {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
}

.task-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.875rem;
  flex-wrap: wrap;
}

.task-meta span {
  font-size: 0.8rem;
  color: var(--text-dim);
  background: var(--surface-2);
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
}

.task-actions { margin-top: 1.25rem; display: flex; gap: 0.5rem; }

/* COMPLETED TASKS LIST */
.tasks-list { list-style: none; }

.tasks-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.tasks-list li:last-child { border-bottom: none; }

.check-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(200,240,96,0.12);
  border: 1px solid rgba(200,240,96,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.check-icon::after {
  content: '';
  width: 5px;
  height: 8px;
  border: 1.5px solid var(--accent);
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: block;
}

/* GOAL FORM PAGE */
.goal-form-wrapper {
  max-width: 600px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.goal-form-wrapper h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.goal-form-wrapper > p {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 0.9375rem;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state p { margin-bottom: 1.25rem; }

/* LOADING SPINNER */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(13,13,13,0.2);
  border-top-color: #0d0d0d;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* SECTION DIVIDER */
.section-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 2rem 0 1rem;
}

/* NO GOAL STATE */
.no-goal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem;
  text-align: center;
}

.no-goal h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.no-goal p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.9375rem; }

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  nav { padding: 1rem 1.25rem; }
  .auth-card { padding: 1.75rem 1.25rem; }
}