/* FEAT-418 West Health Habit Project — member experience styles.
   Palette: West Health teal (#1DB8A0) + navy (#0D2D3A) on warm sand, serif display headings.
   Lucide icons only (brand standard). */

:root {
    --hab-teal: #1DB8A0;
    --hab-teal-dark: #14907d;
    --hab-navy: #0D2D3A;
    --hab-sand: #faf7f2;
    --hab-card: #ffffff;
    --hab-line: #e8e2d8;
    --hab-gold: #d4a72c;
    --hab-silver: #9aa5b1;
    --hab-bronze: #c07a3e;
}

.hab-shell {
    background: var(--hab-sand);
    color: var(--hab-navy);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.hab-main { flex: 1 0 auto; max-width: 1080px; }
.hab-shell h1, .hab-shell h2, .hab-shell h3 { font-family: Georgia, "Times New Roman", serif; color: var(--hab-navy); }
.hab-shell h3 { font-size: 1.15rem; }
.hab-shell a { color: var(--hab-teal-dark); }

/* Topbar */
.hab-topbar { background: var(--hab-navy); color: #fff; position: sticky; top: 0; z-index: 1030; }
.hab-brand { text-decoration: none; color: #fff; }
.hab-brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 12px;
    background: linear-gradient(135deg, var(--hab-teal), #0E8FCC); color: #fff;
}
.hab-brand-mark svg { width: 20px; height: 20px; }
.hab-brand-name { font-family: Georgia, serif; font-weight: 700; font-size: 1.05rem; display: block; line-height: 1.1; }
.hab-brand-name em { color: var(--hab-teal); font-style: normal; }
.hab-brand-tag { font-size: .68rem; letter-spacing: 1.6px; text-transform: uppercase; color: #9fc3ce; }
.hab-nav-link {
    color: #cfe3e9; text-decoration: none; padding: .45rem .7rem; border-radius: 8px;
    font-size: .9rem; display: inline-flex; align-items: center; gap: .35rem;
}
.hab-nav-link svg { width: 16px; height: 16px; }
.hab-nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.hab-nav-link.active { color: #fff; background: rgba(29,184,160,.25); }
.hab-mobilenav {
    display: flex; justify-content: space-around; background: #0a2430; padding: .3rem 0 .4rem;
}
.hab-mobilenav a {
    color: #9fc3ce; text-decoration: none; font-size: .65rem; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 56px;
}
.hab-mobilenav a.active { color: var(--hab-teal); }
.hab-mobilenav svg { width: 20px; height: 20px; }

/* Buttons */
.hab-btn-primary {
    background: var(--hab-teal); border: none; color: #fff; border-radius: 10px;
    display: inline-flex; align-items: center; gap: .45rem; justify-content: center; font-weight: 600;
}
.hab-btn-primary:hover, .hab-btn-primary:focus { background: var(--hab-teal-dark); color: #fff; }
.hab-btn-primary svg { width: 18px; height: 18px; }
.hab-btn-ghost {
    background: transparent; border: 1.5px solid var(--hab-teal); color: var(--hab-teal-dark);
    border-radius: 10px; display: inline-flex; align-items: center; gap: .45rem; justify-content: center; font-weight: 600;
}
.hab-btn-ghost:hover { background: rgba(29,184,160,.1); color: var(--hab-teal-dark); }
.hab-btn-ghost svg { width: 18px; height: 18px; }
.hab-topbar .hab-btn-ghost { border-color: rgba(255,255,255,.4); color: #fff; }
.hab-topbar .hab-btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Cards */
.hab-card {
    background: var(--hab-card); border: 1px solid var(--hab-line); border-radius: 16px;
    padding: 1.4rem; box-shadow: 0 1px 3px rgba(13,45,58,.05);
    display: flex; flex-direction: column;
}
.hab-card-cta { border: 2px dashed var(--hab-teal); background: rgba(29,184,160,.04); }
.hab-eyebrow {
    text-transform: uppercase; letter-spacing: 1.4px; font-size: .7rem; font-weight: 700; color: var(--hab-teal-dark);
}
.hab-section-title { font-size: 1.6rem; }

/* Hero (landing) */
.hab-hero { padding: 3rem 1rem 1rem; }
.hab-hero-eyebrow {
    text-transform: uppercase; letter-spacing: 2px; font-size: .75rem; font-weight: 700; color: var(--hab-teal-dark);
}
.hab-hero-title { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.12; margin-top: .5rem; }
.hab-hero-title em { color: var(--hab-teal); font-style: italic; }
.hab-hero-sub { max-width: 620px; color: #4a6a76; font-size: 1.05rem; }
.hab-step-icon {
    width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
    background: rgba(29,184,160,.12); color: var(--hab-teal-dark); margin-bottom: .8rem;
}
.hab-step-icon svg { width: 26px; height: 26px; }
.hab-quote p { font-family: Georgia, serif; font-size: 1.15rem; font-style: italic; }

/* Tiers */
.hab-tier { position: relative; }
.hab-tier-featured { border: 2px solid var(--hab-teal); box-shadow: 0 6px 18px rgba(29,184,160,.15); }
.hab-tier-flag {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--hab-teal); color: #fff; font-size: .7rem; font-weight: 700;
    padding: 2px 12px; border-radius: 999px; letter-spacing: .8px; text-transform: uppercase;
}
.hab-tier-price { font-family: Georgia, serif; font-size: 2.4rem; font-weight: 700; color: var(--hab-navy); }
.hab-tier-price span { font-size: 1rem; color: #7b8f98; font-weight: 400; }

/* Alerts */
.hab-alert {
    display: flex; align-items: center; gap: .6rem; border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1rem;
}
.hab-alert svg { width: 20px; height: 20px; flex: 0 0 auto; }
.hab-alert-success { background: rgba(29,184,160,.12); color: var(--hab-teal-dark); }
.hab-alert-error { background: rgba(220,53,69,.1); color: #b02a37; }
.hab-alert-celebrate {
    background: linear-gradient(90deg, rgba(212,167,44,.15), rgba(29,184,160,.15));
    color: var(--hab-navy); font-weight: 600; border: 1px solid rgba(212,167,44,.4);
}

/* Chips */
.hab-path-chip {
    display: inline-block; background: color-mix(in srgb, var(--chip, #1DB8A0) 15%, white);
    color: var(--hab-navy); border: 1px solid var(--chip, #1DB8A0);
    border-radius: 999px; padding: 2px 12px; font-size: .8rem; font-weight: 600; margin-right: .4rem;
}
.hab-level-chip {
    display: inline-block; background: var(--hab-navy); color: #fff; border-radius: 999px;
    padding: 2px 12px; font-size: .8rem; font-weight: 600;
}

/* Progress ring (conic) */
.hab-ring {
    --pct: 0;
    width: 92px; height: 92px; border-radius: 50%; flex: 0 0 auto;
    background: conic-gradient(var(--hab-teal) calc(var(--pct) * 1%), #ece6db 0);
    display: flex; align-items: center; justify-content: center; position: relative;
}
.hab-ring::before { content: ""; position: absolute; inset: 8px; background: #fff; border-radius: 50%; }
.hab-ring span { position: relative; font-family: Georgia, serif; font-weight: 700; font-size: 1.3rem; text-align: center; line-height: 1; }
.hab-ring small { display: block; font-size: .6rem; color: #7b8f98; font-family: system-ui; font-weight: 400; }

/* Day grid */
.hab-day-grid { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 1rem; }
.hab-day {
    width: 32px; height: 32px; border-radius: 9px; font-size: .75rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    background: #f2ede4; color: #9aa5ad; border: 1px solid var(--hab-line);
}
.hab-day.done { background: var(--hab-teal); border-color: var(--hab-teal); color: #fff; }
.hab-day.today { outline: 2px solid var(--hab-navy); outline-offset: 1px; }

/* Streak */
.hab-streak-flame {
    width: 64px; height: 64px; margin: 0 auto .3rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #f2ede4; color: #b9c2c9;
}
.hab-streak-flame.lit { background: rgba(249,115,22,.15); color: #f97316; animation: hab-flicker 1.6s infinite alternate; }
.hab-streak-flame svg { width: 32px; height: 32px; }
@keyframes hab-flicker { from { transform: scale(1); } to { transform: scale(1.07); } }
.hab-streak-count { font-family: Georgia, serif; font-size: 2.6rem; font-weight: 700; line-height: 1; }

/* Badges */
.hab-badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; margin-top: .6rem; }
.hab-badge {
    text-align: center; padding: .7rem .3rem; border-radius: 12px; background: #f6f2ea;
    color: #b3bcc3; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.hab-badge svg { width: 26px; height: 26px; }
.hab-badge span { font-size: .62rem; font-weight: 600; line-height: 1.15; }
.hab-badge.earned { background: color-mix(in srgb, var(--badge, #1DB8A0) 14%, white); color: var(--badge, #1DB8A0); box-shadow: inset 0 0 0 1.5px var(--badge, #1DB8A0); }
.badge.hab-badge-active { background: rgba(29,184,160,.15); color: var(--hab-teal-dark); }
.badge.hab-badge-soon { background: #eee7db; color: #8d99a1; }
.badge.hab-badge-soon svg { width: 11px; height: 11px; }

/* Assessment */
.hab-progress { height: 8px; border-radius: 999px; background: #ece6db; overflow: hidden; }
.hab-progress-bar { height: 100%; width: 0; background: var(--hab-teal); transition: width .3s ease; }
.hab-question { display: none; }
.hab-question.active { display: flex; }
.hab-options { display: flex; flex-direction: column; gap: .6rem; }
.hab-option {
    display: flex; align-items: center; gap: .7rem; border: 1.5px solid var(--hab-line);
    border-radius: 12px; padding: .85rem 1rem; cursor: pointer; transition: all .15s ease; margin: 0;
}
.hab-option:hover { border-color: var(--hab-teal); background: rgba(29,184,160,.05); }
.hab-option:has(input:checked) { border-color: var(--hab-teal); background: rgba(29,184,160,.1); font-weight: 600; }
.hab-option input { accent-color: var(--hab-teal); }

/* Result score bars */
.hab-score-row { display: flex; align-items: center; gap: .7rem; margin-top: .45rem; }
.hab-score-label { flex: 0 0 150px; font-size: .85rem; font-weight: 600; }
.hab-score-track { flex: 1; height: 10px; background: #ece6db; border-radius: 999px; overflow: hidden; }
.hab-score-fill { height: 100%; background: linear-gradient(90deg, var(--hab-teal), #0E8FCC); border-radius: 999px; }
.hab-score-num { flex: 0 0 26px; text-align: right; font-weight: 700; font-size: .85rem; }

/* Challenge levels */
.hab-level-card {
    display: flex; flex-direction: column; gap: .3rem; border: 2px solid var(--hab-line);
    border-radius: 14px; padding: 1rem; cursor: pointer; height: 100%; margin: 0; transition: all .15s ease;
}
.hab-level-card input { position: absolute; opacity: 0; }
.hab-level-name { font-family: Georgia, serif; font-weight: 700; font-size: 1.1rem; }
.hab-level-desc { font-weight: 600; font-size: .9rem; }
.hab-level-note { font-size: .75rem; color: #7b8f98; }
.hab-level-card.bronze .hab-level-name { color: var(--hab-bronze); }
.hab-level-card.silver .hab-level-name { color: var(--hab-silver); }
.hab-level-card.gold .hab-level-name { color: var(--hab-gold); }
.hab-level-card:has(input:checked) { border-color: var(--hab-teal); background: rgba(29,184,160,.07); box-shadow: 0 4px 12px rgba(29,184,160,.12); }

/* Challenge library */
.hab-challenge-card .hab-challenge-badge { width: 22px; height: 22px; color: var(--hab-teal); }
.hab-locked { opacity: .65; }

/* Community wins */
.hab-win-row { padding: .45rem 0; border-bottom: 1px dashed var(--hab-line); font-size: .92rem; }
.hab-win-row:last-child { border-bottom: none; }

/* Teams */
.hab-team { position: relative; overflow: hidden; }
.hab-team-stripe { position: absolute; top: 0; left: 0; right: 0; height: 6px; background: var(--team, #1DB8A0); }
.hab-team.mine { box-shadow: 0 0 0 2px var(--team, #1DB8A0); }
.hab-stat-num { font-family: Georgia, serif; font-size: 1.7rem; font-weight: 700; }

/* Moments feed */
.hab-moments h3 { margin-bottom: .5rem; }
.hab-moment { padding: .55rem 0; border-bottom: 1px dashed var(--hab-line); }
.hab-moment:last-child { border-bottom: none; }
.hab-moment.fresh { position: relative; padding-left: .8rem; }
.hab-moment.fresh::before {
    content: ""; position: absolute; left: 0; top: .8rem; bottom: .6rem;
    width: 3px; border-radius: 3px; background: var(--hab-teal);
}

/* Ceremony (full-screen celebration) */
.hab-ceremony {
    position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center;
    background: rgba(13,45,58,.72); backdrop-filter: blur(4px); padding: 1rem;
    animation: hab-fade-in .3s ease;
}
.hab-ceremony-card {
    position: relative; background: var(--hab-card); border-radius: 22px; text-align: center;
    max-width: 480px; width: 100%; padding: 2rem 1.6rem; overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.4);
    animation: hab-pop .45s cubic-bezier(.18,1.25,.4,1);
}
.hab-ceremony-card #habConfetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hab-ceremony-art {
    width: min(280px, 70vw); border-radius: 18px; margin-bottom: 1rem;
    box-shadow: 0 10px 34px rgba(13,45,58,.25);
}
.hab-ceremony-burst {
    width: 96px; height: 96px; margin: 0 auto 1rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(29,184,160,.18), rgba(212,167,44,.2)); color: var(--hab-gold);
}
.hab-ceremony-burst svg { width: 46px; height: 46px; }
.hab-ceremony-card h2 { font-size: 1.5rem; }
.hab-ceremony-card p { color: #4a6a76; }
@keyframes hab-pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes hab-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Trophy room */
.hab-trophy-art { width: 100%; max-width: 190px; margin: 0 auto .6rem; border-radius: 14px; }
.hab-trophy-icon {
    width: 84px; height: 84px; margin: 0 auto .6rem; border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--badge, #9aa5b1) 14%, white); color: var(--badge, #9aa5b1);
}
.hab-trophy-icon svg { width: 40px; height: 40px; }
.hab-trophy.locked { opacity: .55; filter: grayscale(.7); }
.hab-trophy.earned { box-shadow: inset 0 0 0 1.5px var(--badge, #1DB8A0); }
.hab-poster img { aspect-ratio: 1; object-fit: cover; }

/* Footer */
.hab-footer { background: transparent; color: #7b8f98; }
