:root{
  --bg:#080b12;
  --surface:#111827;
  --gold:#c9a84c;
  --goldLight:#e8c96e;
  --text:#e8e4d8;
  --muted:#9a968a;
  --border:rgba(201,168,76,0.18);
  --danger:#cf3f3f;
}

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

body{
  background:var(--bg);
  color:var(--text);
  font-family:'DM Sans',sans-serif;
  padding-bottom:100px;
}

.hidden{
  display:none!important;
}

h1,h2,h3{
  font-family:'Playfair Display',serif;
}

.auth-screen{
  min-height:100vh;
  display:flex;
  justify-content:center;
  align-items:center;
  padding:20px;
}

.auth-card{
  width:100%;
  max-width:420px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:12px;
  padding:30px;
}

.auth-card h1{
  text-align:center;
  margin-bottom:10px;
}

.subtitle{
  text-align:center;
  color:var(--muted);
  margin-bottom:20px;
}

input,
textarea,
button{
  width:100%;
  border:none;
  outline:none;
  border-radius:8px;
  font-family:inherit;
}

input,
textarea{
  background:#0f172a;
  color:white;
  border:1px solid var(--border);
  padding:14px;
  margin-bottom:15px;
}

textarea{
  min-height:120px;
  resize:vertical;
}

button{
  padding:14px;
  cursor:pointer;
  background:var(--gold);
  color:black;
  font-weight:700;
  transition:.25s;
}

button:hover{
  transform:translateY(-2px);
}

.secondary-btn{
  margin-top:10px;
  background:#1f2937;
  color:white;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:20px;
}

.page{
  display:none;
  padding:20px;
}

.active-page{
  display:block;
}

.card,
.hero-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:12px;
  padding:20px;
  margin-bottom:20px;
}

.hero-card{
  text-align:center;
}

.hero-card h1{
  font-size:4rem;
  color:var(--goldLight);
}

.grid{
  display:grid;
  gap:16px;
}

.stats-grid{
  grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
}

.badges{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.badge{
  background:#0f172a;
  border:1px solid var(--border);
  padding:10px 14px;
  border-radius:999px;
}

.badge.unlocked{
  background:var(--gold);
  color:black;
}

.bottom-nav{
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  display:flex;
  overflow-x:auto;
  background:#0f172a;
  border-top:1px solid var(--border);
}

.bottom-nav button{
  min-width:120px;
  background:transparent;
  color:var(--text);
  border-radius:0;
}

.calendar-grid{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:8px;
}

.day{
  aspect-ratio:1;
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  background:#1e293b;
}

.clean{
  background:#1f8a4c;
}

.relapse{
  background:#992d2d;
}

.today{
  border:2px solid #ffe27a;
}

.heatmap{
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:4px;
}

.heat-cell{
  width:100%;
  aspect-ratio:1;
  border-radius:4px;
  background:#1e293b;
}

.chart{
  display:flex;
  align-items:flex-end;
  gap:10px;
  height:180px;
}

.bar{
  flex:1;
  background:var(--gold);
  border-radius:6px 6px 0 0;
}

.moods{
  display:flex;
  gap:10px;
  margin-bottom:20px;
}

.mood-btn{
  font-size:1.5rem;
  background:#1f2937;
}

.mood-btn.selected{
  border:2px solid var(--gold);
}

.center{
  text-align:center;
}

#breathingCircle{
  width:220px;
  height:220px;
  border-radius:50%;
  background:rgba(201,168,76,0.1);
  border:2px solid var(--gold);
  margin:30px auto;
  display:flex;
  justify-content:center;
  align-items:center;
  transition:4s;
}

.breathing{
  transform:scale(1.2);
}

.exercise-grid,
.emergency-grid{
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
}

.accordion{
  margin-bottom:16px;
}

.accordion-header{
  background:var(--surface);
  padding:16px;
  border-radius:12px;
  cursor:pointer;
  border:1px solid var(--border);
}

.accordion-content{
  display:none;
  padding:16px;
  color:var(--muted);
}

.timeline-item{
  border-left:2px solid var(--gold);
  padding-left:20px;
  margin-bottom:30px;
}

.timeline-item.active h3{
  color:var(--goldLight);
}

.account-panel{
  position:fixed;
  right:20px;
  bottom:90px;
  width:320px;
}

#profileIcon{
  width:45px;
  height:45px;
  border-radius:50%;
  background:var(--gold);
  cursor:pointer;
}

#toastContainer{
  position:fixed;
  top:20px;
  right:20px;
  z-index:9999;
}

.toast{
  background:var(--surface);
  border:1px solid var(--border);
  padding:14px;
  border-radius:10px;
  margin-bottom:10px;
}

.danger-btn{
  background:var(--danger);
  color:white;
}

.danger-outline{
  background:transparent;
  border:1px solid var(--danger);
  color:#ff8080;
  margin-top:10px;
}

@media(max-width:768px){

  .hero-card h1{
    font-size:3rem;
  }

  .bottom-nav{
    padding-bottom:8px;
  }

}