@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=Syne:wght@700;800&display=swap');

@font-face {
  font-family: "RapierZero";
  src: url(/fonts/RapierZero.otf) format('opentype');
}

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

:root {
  --orange:        #ff6b35;
  --orange-dim:    #cc4e1f;
  --orange-glow:   rgba(255, 107, 53, 0.12);
  --blue:          #2d2b55;
  --blue-bright:   #4f8ef7;
  --blue-glow:     rgba(45, 43, 85, 0.12);
  --bg:            #faf8f4;
  --bg-card:       #ffffff;
  --bg-card-hover: #f5f2ec;
  --bg-dark:       #1a1830;
  --bg-dark-card:  #2d2b55;
  --bg-input:      #f0ece4;
  --border:        rgba(0,0,0,0.08);
  --border-bright: rgba(0,0,0,0.15);
  --text:          #1a1a24;
  --text-muted:    #6b6880;
  --text-faint:    #b0adc0;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     20px;
  --shadow:        0 4px 24px rgba(0,0,0,0.08);
  --transition:    200ms ease;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: 'Syne', sans-serif;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem);  font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--orange); }

/* ── Utilities ── */
.flex-spacer { flex-grow: 1; }
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--orange-glow);
  color: var(--orange);
  border: 1px solid rgba(255,107,53,0.3);
}

/* ── Buttons ── */
button { cursor: pointer; font-family: inherit; border: none; outline: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--orange);
  color: #fff;
}
.btn-primary:hover { background: var(--orange-dim); transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-bright);
}
.btn-secondary:hover { background: var(--bg-card); border-color: var(--orange); color: var(--orange); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 16px;
}
.btn-ghost:hover { color: var(--text); }
.btn-danger {
  background: transparent;
  color: #e05555;
  border-color: rgba(224,85,85,0.3);
}
.btn-danger:hover { background: rgba(224,85,85,0.1); }

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--orange);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
  border: none;
}
.cta-button:hover { background: var(--orange-dim); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,107,53,0.35); }

/* ── Inputs ── */
input, textarea, select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  transition: var(--transition);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
select option { background: var(--bg-card); }
textarea { resize: vertical; min-height: 80px; }

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 64px;
  background: rgba(250,248,244,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo-img {
  height: 36px;
  width: 36px;
  filter: drop-shadow(0 0 8px rgba(255,107,53,0.5));
}

.logo-text {
  font-family: RapierZero, 'Syne', sans-serif;
  font-size: 20px;
  white-space: nowrap;
}
.logo-text .work { color: var(--blue); }
.logo-text .play { color: var(--orange); }

.banner-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}
.banner-buttons button {
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: var(--transition);
}
.banner-buttons button:hover {
  color: var(--text);
  border-color: var(--border-bright);
}
.banner-buttons button#sign-out {
  color: var(--orange);
  border-color: rgba(255,107,53,0.3);
}
.banner-buttons button#sign-out:hover {
  background: var(--orange-glow);
}

.auth-status {
  font-size: 12px;
  color: var(--text-faint);
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 24px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 13px;
  transition: var(--transition);
}
.footer-links a:hover { color: var(--orange); }

/* ── Auth Modal ── */
.auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
.auth-modal[style*="block"] { display: flex !important; }

.auth-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 90%;
  max-width: 420px;
  position: relative;
  box-shadow: var(--shadow);
  animation: slideUp 200ms ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}
.auth-modal-close:hover { color: var(--orange); }

.auth-modal-content h2 {
  margin-bottom: 24px;
  font-size: 1.5rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-divider {
  text-align: center;
  position: relative;
  margin: 16px 0;
  color: var(--text-faint);
  font-size: 13px;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  background: var(--bg-card);
  padding: 0 10px;
  position: relative;
}

.google-button {
  width: 100%;
  padding: 11px;
  background: #fff;
  color: #333;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
  border: none;
}
.google-button:hover { background: #f0f0f0; }

/* ── Landing Page ── */
.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 30% 50%, rgba(45,43,85,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 70% 50%, rgba(255,107,53,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  max-width: 720px;
}
.hero-content .eyebrow {
  display: inline-block;
  margin-bottom: 20px;
}
.hero-content h1 {
  margin-bottom: 20px;
}
.hero-content h1 .accent-blue  { color: var(--blue); }
.hero-content h1 .accent-orange { color: var(--orange); }
.hero-content .tagline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  margin-bottom: 36px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Features section */
.features {
  padding: 80px 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.features > h2 {
  text-align: center;
  margin-bottom: 48px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: var(--transition);
}
.feature-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.feature-card .icon {
  font-size: 28px;
  margin-bottom: 14px;
}
.feature-card h3 { margin-bottom: 8px; }
.feature-card p  { color: var(--text-muted); font-size: 14px; }

/* About section */
.about-section {
  padding: 80px 24px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.about-row {
  display: flex;
  gap: 48px;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto 60px;
}
.about-row:last-child { margin-bottom: 0; }
.about-row.reverse { flex-direction: row-reverse; }
.about-wrapper {
  flex: 1;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}
.about-wrapper img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  filter: brightness(0.85);
}
.about-wrapper span {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(15,15,19,0.85);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid var(--border-bright);
}
.blurb {
  flex: 1;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.8;
}

/* ── App Dashboard ── */
.app-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
  background: var(--bg-dark);
}

/* Sidebar */
.sidebar {
  background: var(--bg-dark-card);
  border-right: 1px solid rgba(255,255,255,0.06);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-section {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.2);
  padding: 8px 12px 4px;
  margin-top: 8px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-item:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.9); }
.sidebar-item.active { background: var(--orange-glow); color: var(--orange); }
.sidebar-item .icon { font-size: 16px; width: 20px; text-align: center; }

/* Stats bar in sidebar */
.stat-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 8px;
}
.stat-card .stat-label {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.stat-card .stat-value {
  font-size: 22px;
  font-weight: 700;
  font-family: 'Syne', sans-serif;
  color: var(--orange);
}
.stat-card .stat-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  margin-top: 2px;
}

/* Main content area */
.app-main {
  padding: 32px;
  overflow-y: auto;
  background: var(--bg-dark);
  color: #f0f0f5;
}
.app-main h2, .app-main h3 { color: #f0f0f5; }
.app-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.app-main-header h2 { font-size: 1.6rem; }

/* Task form */
.task-form {
  background: var(--bg-dark-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.task-form input,
.task-form textarea,
.task-form select {
  background: rgba(0,0,0,0.2);
  border-color: rgba(255,255,255,0.08);
  color: #f0f0f5;
}
.task-form input::placeholder,
.task-form textarea::placeholder { color: rgba(255,255,255,0.2); }
.task-form select option { background: var(--bg-dark-card); }
.task-form .full-width { grid-column: 1 / -1; }
.task-form-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
}

/* Task cards */
.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.task-card {
  background: var(--bg-dark-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.task-card:hover { border-color: rgba(255,255,255,0.12); transform: translateY(-1px); }
.task-card.completed { opacity: 0.5; }
.task-card.completed .task-title { text-decoration: line-through; }

.task-title {
  font-size: 15px;
  font-weight: 600;
  color: #f0f0f5;
}
.task-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.task-category {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--blue-glow);
  color: var(--blue-bright);
  border: 1px solid rgba(79,142,247,0.25);
  font-weight: 600;
}
.task-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
}
.task-status.pending    { background: rgba(255,200,0,0.1); color: #ffc800; border: 1px solid rgba(255,200,0,0.2); }
.task-status.completed  { background: rgba(0,200,100,0.1); color: #00c864; border: 1px solid rgba(0,200,100,0.2); }
.task-status.in_progress { background: var(--blue-glow); color: var(--blue-bright); border: 1px solid rgba(79,142,247,0.25); }

.task-description {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.task-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.complete-button {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  background: var(--orange-glow);
  color: var(--orange);
  border: 1px solid rgba(255,107,53,0.3);
  transition: var(--transition);
}
.complete-button:hover { background: var(--orange); color: #fff; }
.complete-button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Goals section */
.goal-card {
  background: var(--bg-dark-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  color: #f0f0f5;
}
.goal-card:hover { border-color: rgba(255,255,255,0.12); }
.goal-progress-bar {
  height: 6px;
  background: var(--bg-dark);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 10px;
}
.goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-bright), var(--orange));
  border-radius: 99px;
  transition: width 600ms ease;
}

/* Points & streak display */
.points-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--orange-glow);
  border: 1px solid rgba(255,107,53,0.3);
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  color: var(--orange);
}
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255,200,0,0.1);
  border: 1px solid rgba(255,200,0,0.25);
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  color: #ffc800;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: toastIn 300ms ease;
  max-width: 320px;
}
.toast.success { border-left: 3px solid #00c864; }
.toast.error   { border-left: 3px solid #e05555; }
.toast.info    { border-left: 3px solid var(--blue-bright); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: rgba(255,255,255,0.3);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { margin-bottom: 8px; color: rgba(255,255,255,0.7); }
.empty-state p  { font-size: 14px; }

/* ── Icons ── */
.icon svg, .feature-card .icon svg {
  display: block;
}
.feature-card .icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--orange-glow);
  border: 1px solid rgba(255,107,53,0.2);
  border-radius: var(--radius-sm);
  color: var(--orange);
  margin-bottom: 14px;
}
.feature-card .icon svg { width: 20px; height: 20px; }
.task-category svg, .task-description svg {
  display: inline;
  vertical-align: middle;
  margin-right: 3px;
}
.empty-state .empty-icon svg {
  width: 40px;
  height: 40px;
  opacity: 0.3;
}
.complete-button svg, .btn svg {
  display: inline;
  vertical-align: middle;
}

/* Responsive */
@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .about-row { flex-direction: column; }
  .task-form { grid-template-columns: 1fr; }
}

/* Fix filter button colors on dark dashboard */
.app-main .filter-btn.btn-secondary {
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.15);
}

.app-main .filter-btn.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

/* Active state */
.app-main .filter-btn.active {
  background: var(--orange);
  color: #ffffff;
  border-color: var(--orange);
}