/* =========================================================
   OTR — "Quiet Room" theme
   Drop-in replacement for static/css/app.css
   Fonts loaded separately in templates/base.html <head>
   ========================================================= */

:root{
  --bg:#f4f3ee;
  --ink:#333a2e;
  --sub:#767d6c;
  --panel:#fbfaf7;
  --line:#e6e4db;

  --sage:#8a9a7e;
  --sage-dark:#5c7350;
  --sage-tint:#eaf0e6;

  --clay:#c98b74;
  --clay-dark:#a15a3f;
  --clay-tint:#f6ece7;

  --radius:14px;
  --radius-lg:20px;
}

*{ box-sizing:border-box; }

html, body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:'Inter', sans-serif;
}

h1, h2, h3, .brand{ font-family:'Sora', sans-serif; }

a{ color:inherit; }

/* ---------- layout shell ---------- */
.app{
  max-width:1040px;
  margin:0 auto;
  min-height:100vh;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:20px 32px;
  border-bottom:1px solid var(--line);
  position:sticky;
  top:0;
  background:var(--bg);
  z-index:10;
}

.brand{
  font-weight:600;
  font-size:19px;
  letter-spacing:-.01em;
  display:flex;
  align-items:center;
  gap:9px;
  text-decoration:none;
}
.brand .mark{
  width:22px; height:22px; border-radius:50%;
  background:radial-gradient(circle at 35% 35%, var(--sage-tint), var(--sage));
  display:inline-block;
}

/* Mobile-first: short wordmark is the base case (narrow viewports have
   little room next to nav links / the auth form); widen to the full name
   once there's space for it. */
.brand-name-full{ display:none; }
@media(min-width:640px){
  .brand-name-full{ display:inline; }
  .brand-name-short{ display:none; }
}

/* The short wordmark is an abbreviation, so pair it with a native tooltip
   (title attr) explaining it. Override the browser default dotted
   underline to match the rest of the brand mark; cursor:help is the
   desktop hover affordance — there's no touch equivalent, but screen
   readers on any device still announce the title as the expansion. */
.brand-abbr{ text-decoration:none; cursor:help; }

.navlinks{ display:flex; gap:6px; }
.navlinks a{
  background:none; border:none; font-family:'Inter'; font-size:14px; font-weight:500;
  color:var(--sub); padding:8px 14px; border-radius:999px; cursor:pointer; transition:.15s;
  text-decoration:none; display:inline-block;
}
.navlinks a:hover{ background:var(--panel); color:var(--ink); }
.navlinks a.active{ background:var(--sage-tint); color:var(--sage-dark); font-weight:600; }

.avatar{
  width:34px; height:34px; border-radius:50%; background:#e3dfd2; color:#5c6350;
  display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:600;
  text-decoration:none;
}
/* Logout is a <button> (POST-only, per Django 5's LogoutView) styled to
   match the .avatar look — reset the browser's default button chrome. */
.avatar-btn{ border:none; padding:0; cursor:pointer; font-family:inherit; }

.page{ padding:32px; }

.eyebrow{ font-size:13px; color:var(--sub); margin-bottom:2px; }
.pagehead{ display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:24px; flex-wrap:wrap; gap:14px; }
.pagehead h1{ font-size:26px; font-weight:600; margin:0; letter-spacing:-.01em; }

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:6px; padding:9px 16px; border-radius:999px;
  font-size:13px; font-weight:600; border:none; cursor:pointer; font-family:'Inter';
  text-decoration:none;
}
.btn-primary{ background:var(--sage); color:#fff; }
.btn-primary:hover{ background:var(--sage-dark); }
.btn-ghost{ background:var(--panel); color:var(--ink); border:1px solid var(--line); }
.btn-ghost:hover{ background:#f0efe6; }

/* ---------- grid / cards ---------- */
.grid{ display:grid; grid-template-columns:1.25fr 1fr; gap:20px; align-items:start; }
@media(max-width:760px){ .grid{ grid-template-columns:1fr; } }

.card{ background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:22px; }
.card + .card{ margin-top:20px; }
.card h3{ margin:0 0 4px; font-size:15px; font-weight:600; }
.card-sub{ font-size:13px; color:var(--sub); margin:0 0 16px; }
.card-headrow{ display:flex; align-items:baseline; justify-content:space-between; margin-bottom:2px; }
.linkout{ font-size:13px; font-weight:600; color:var(--sage-dark); text-decoration:none; cursor:pointer; }
.linkout:hover{ text-decoration:underline; }

/* ---------- dashboard hero ---------- */
.daycount{ font-size:42px; font-weight:600; margin:0 0 6px; letter-spacing:-.01em; }
.daycount .num{ color:var(--clay-dark); }
.daysub{ font-size:14px; color:var(--sub); margin:0 0 28px; }

/* ---------- friend rows ---------- */
.friend-row{ display:flex; align-items:center; gap:13px; padding:12px 0; border-bottom:1px solid var(--line); }
.friend-row:last-child{ border-bottom:none; }
.medal{
  width:44px; height:44px; border-radius:50%; flex-shrink:0;
  background:radial-gradient(circle at 35% 30%, var(--sage-tint), #f4f3ee);
  display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; color:var(--sage-dark);
}
.friend-main{ flex:1; min-width:0; }
.friend-name{ font-weight:600; font-size:14px; margin-bottom:5px; }
.progress-track{ height:5px; border-radius:3px; background:#eae7dc; overflow:hidden; }
.progress-fill{ height:100%; border-radius:3px; background:var(--sage); }
.friend-meta{ font-size:12.5px; color:var(--sub); white-space:nowrap; text-align:right; }
.friend-meta b{ color:var(--ink); font-weight:600; }

/* ---------- reflections ---------- */
.quote-block{ font-size:16px; line-height:1.5; margin:0 0 14px; font-weight:500; }
.reflect-input{
  width:100%; border:1px solid var(--line); background:#f0efe6; border-radius:10px;
  padding:12px 14px; font-size:13px; font-family:inherit; color:var(--ink); resize:none;
}
.streak-pill{
  display:inline-flex; align-items:center; gap:6px; background:var(--clay-tint); color:var(--clay-dark);
  font-size:12.5px; font-weight:600; padding:6px 12px; border-radius:999px;
}
.journal-entry{ padding:14px 0; border-bottom:1px solid var(--line); }
.journal-entry:last-child{ border-bottom:none; }
.journal-date{ font-size:12px; color:var(--sub); margin-bottom:4px; font-weight:600; letter-spacing:.02em; text-transform:uppercase; }
.journal-prompt{ font-size:12.5px; color:var(--sub); margin-bottom:4px; }
.journal-text{ font-size:14px; line-height:1.5; }

/* ---------- groups ---------- */
.chat-preview{ background:#f0efe6; border-radius:10px; padding:14px; margin:14px 0; }
.chat-msg{ font-size:13px; margin-bottom:8px; line-height:1.5; }
.chat-msg:last-child{ margin-bottom:0; }
.chat-msg b{ font-weight:600; }
.chip-row{ display:flex; gap:8px; flex-wrap:wrap; }
.chip{ font-size:12px; padding:6px 12px; border-radius:999px; font-weight:600; border:1px solid transparent; cursor:pointer; background:none; font-family:'Inter'; }
.chip.add{ background:var(--sage-tint); color:var(--sage-dark); }
.chip.leave{ background:var(--clay-tint); color:var(--clay-dark); }
.group-card{ display:flex; gap:16px; align-items:flex-start; }
.group-card.selected{ border-color:var(--sage); }
.stack{ display:flex; }
.stack .avatar{ width:28px; height:28px; font-size:11px; margin-left:-8px; border:2px solid var(--panel); }
.stack .avatar:first-child{ margin-left:0; }

/* ---------- search / sort toolbar ---------- */
.toolbar{ display:flex; gap:10px; align-items:center; margin-bottom:18px; flex-wrap:wrap; }
.search{ flex:1; min-width:180px; position:relative; }
.search input{
  width:100%; padding:10px 14px 10px 34px; border-radius:999px; border:1px solid var(--line);
  background:var(--panel); font-size:13px; font-family:inherit; color:var(--ink);
}
.search::before{ content:"⌕"; position:absolute; left:13px; top:50%; transform:translateY(-50%); color:var(--sub); font-size:14px; }
.sortbtns{ display:flex; gap:6px; background:var(--panel); border:1px solid var(--line); border-radius:999px; padding:3px; }
.sortbtns button, .sortbtns a{
  background:none; border:none; font-size:12.5px; font-weight:600; padding:7px 13px; border-radius:999px;
  cursor:pointer; color:var(--sub); font-family:'Inter'; text-decoration:none; display:inline-block;
}
.sortbtns .active{ background:var(--sage-tint); color:var(--sage-dark); }

/* =========================================================
   Auth screen (login / sign up)
   ========================================================= */
.auth-screen{ display:flex; min-height:100vh; flex-wrap:wrap; }

.auth-hero{
  flex:1.1; min-width:320px; position:relative; overflow:hidden; padding:56px;
  display:flex; flex-direction:column; justify-content:center;
  background:linear-gradient(160deg,#eef1e9 0%, var(--bg) 60%);
}
.auth-hero::before, .auth-hero::after{ content:""; position:absolute; border-radius:50%; opacity:.5; }
.auth-hero::before{ width:340px; height:340px; background:radial-gradient(circle, var(--sage-tint), transparent 70%); top:-80px; right:-100px; }
.auth-hero::after{ width:260px; height:260px; background:radial-gradient(circle, var(--clay-tint), transparent 70%); bottom:-60px; right:120px; }
.auth-hero-inner{ position:relative; max-width:420px; }
.auth-brand{ display:flex; align-items:center; gap:9px; font-weight:600; font-size:19px; margin-bottom:40px; text-decoration:none; color:var(--ink); }
.auth-hero h1{ font-size:30px; line-height:1.28; font-weight:600; letter-spacing:-.01em; margin:0 0 16px; }
.auth-hero p.lede{ font-size:15px; line-height:1.6; color:var(--sub); margin:0 0 32px; }

.feature-row{ display:flex; gap:14px; align-items:flex-start; margin-bottom:18px; }
.feature-icon{
  width:36px; height:36px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center;
  background:var(--panel); border:1px solid var(--line); font-size:15px;
}
.feature-copy b{ display:block; font-size:14px; font-weight:600; margin-bottom:2px; }
.feature-copy span{ font-size:13px; color:var(--sub); line-height:1.5; }

.auth-panel{ flex:1; min-width:320px; display:flex; align-items:center; justify-content:center; padding:56px 40px; background:var(--bg); }
.auth-card{ width:100%; max-width:360px; }
.auth-tabs{ display:flex; gap:6px; background:var(--panel); border:1px solid var(--line); border-radius:999px; padding:4px; margin-bottom:28px; }
.auth-tabs a{
  flex:1; text-align:center; background:none; border:none; font-family:'Inter'; font-size:13px; font-weight:600;
  padding:9px 0; border-radius:999px; cursor:pointer; color:var(--sub); text-decoration:none; display:block;
}
.auth-tabs a.active{ background:var(--sage-tint); color:var(--sage-dark); }

.field{ margin-bottom:16px; }
.field label{ display:block; font-size:12.5px; font-weight:600; margin-bottom:6px; color:var(--ink); }
.field input{
  width:100%; padding:11px 14px; border-radius:10px; border:1px solid var(--line); background:var(--panel);
  font-size:14px; font-family:inherit; color:var(--ink);
}
.field input:focus{ outline:2px solid var(--sage); outline-offset:1px; }
.field .errorlist{ list-style:none; margin:6px 0 0; padding:0; font-size:12px; color:var(--clay-dark); }

.auth-submit{ width:100%; padding:12px 0; border-radius:999px; text-align:center; margin-top:6px; display:block; }
.auth-fine{ font-size:12.5px; color:var(--sub); text-align:center; margin-top:18px; line-height:1.6; }
.auth-fine a{ color:var(--sage-dark); font-weight:600; text-decoration:none; }
.auth-fine a:hover{ text-decoration:underline; }

.non-field-errors{
  background:var(--clay-tint); color:var(--clay-dark); border-radius:10px; padding:10px 14px;
  font-size:13px; margin-bottom:16px; list-style:none;
}

/* ---------- messages (django.contrib.messages) ---------- */
.messages{ list-style:none; margin:0 0 20px; padding:0; }
.messages li{
  background:var(--sage-tint); color:var(--sage-dark); padding:10px 16px; border-radius:10px;
  font-size:13px; font-weight:500; margin-bottom:8px;
}
.messages li.error{ background:var(--clay-tint); color:var(--clay-dark); }
