/* ===== EASE-IN Global Styles ===== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --purple:#6C63FF;--purple-d:#4A45B5;--purple-l:#EDE9FF;
  --teal:#43B89C;--coral:#FF6584;--success:#2ECC71;--danger:#E74C3C;--warn:#F39C12;
  --bg:#F7F7FB;--surface:#FFFFFF;--text:#1A1A2E;--muted:#6B7280;--border:#E5E7EB;
  --r:12px;--rs:8px;--shadow:0 2px 12px rgba(108,99,255,.08)
}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:var(--bg);color:var(--text);min-height:100vh}
a{text-decoration:none}

/* ===== AUTH ===== */
.auth-page{display:flex;align-items:center;justify-content:center;padding:2rem;min-height:100vh;background:linear-gradient(135deg,#EDE9FF 0%,#F0FBF8 100%)}
.auth-wrap{width:100%;max-width:420px}
.brand{text-align:center;margin-bottom:2rem}
.brand-logo{width:60px;height:60px;background:var(--purple);border-radius:18px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:26px;font-weight:700;margin:0 auto 12px}
.brand h1{font-size:28px;font-weight:700;letter-spacing:-.5px}
.brand p,.brand-p{color:var(--muted);font-size:14px;margin-top:4px}
.auth-card{background:var(--surface);border-radius:var(--r);padding:2rem;box-shadow:var(--shadow);border:1px solid var(--border)}
.auth-card h2,.auth-card h3{font-size:20px;font-weight:600;margin-bottom:1.25rem}
.auth-card input,.auth-card select{width:100%;border:1px solid var(--border);border-radius:var(--rs);padding:12px 14px;font-size:14px;margin-bottom:12px;outline:none;font-family:inherit;transition:border .2s}
.auth-card input:focus,.auth-card select:focus{border-color:var(--purple)}
.google-btn{display:flex;align-items:center;justify-content:center;gap:10px;padding:12px;border:1px solid var(--border);border-radius:var(--rs);cursor:pointer;font-size:14px;font-weight:500;background:#fff;text-decoration:none;color:var(--text);margin-bottom:12px;transition:background .2s}
.google-btn:hover{background:#F9FAFB}
.divider{display:flex;align-items:center;gap:12px;margin:8px 0;color:var(--muted);font-size:12px}
.divider::before,.divider::after{content:'';flex:1;height:1px;background:var(--border)}
.btn-primary{width:100%;padding:12px;background:var(--purple);color:#fff;border:none;border-radius:var(--rs);font-size:15px;font-weight:600;cursor:pointer;transition:background .2s}
.btn-primary:hover{background:var(--purple-d)}
.switch-link{text-align:center;font-size:13px;color:var(--muted);margin-top:14px}
.switch-link a{color:var(--purple);cursor:pointer;font-weight:500}
.alert{padding:10px 14px;border-radius:var(--rs);font-size:13px;margin-bottom:12px}
.alert-error{background:#FDECEA;color:#C0392B;border:1px solid #F0997B}
.alert-success{background:#E8F8F0;color:#1E8449;border:1px solid #5DCAA5}

/* ===== AVATAR BUILDER ===== */
.builder-page{padding:2rem;background:var(--bg);min-height:100vh}
.builder-wrap{max-width:860px;margin:0 auto}
.builder-header{text-align:center;margin-bottom:2rem}
.builder-header h2{font-size:24px;font-weight:700}
.builder-header p{color:var(--muted);margin-top:4px}
.back-link{display:inline-block;margin-bottom:1rem;color:var(--purple);font-size:14px}
.builder-layout{display:grid;grid-template-columns:240px 1fr;gap:1.5rem;align-items:start}
@media(max-width:600px){.builder-layout{grid-template-columns:1fr}}

.preview-panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);padding:1.5rem;text-align:center;position:sticky;top:1rem}
.av-display{width:150px;height:190px;margin:0 auto 12px;position:relative}
.av-face{width:110px;height:110px;border-radius:50%;position:absolute;top:20px;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;border:2px solid rgba(0,0,0,.06);overflow:hidden}
.av-hair{position:absolute;top:8px;left:50%;transform:translateX(-50%);width:126px;height:60px;border-radius:63px 63px 0 0;z-index:1}
.av-eyes{display:flex;gap:16px;margin-top:8px;position:relative;z-index:2}
.av-eye{width:12px;height:12px;border-radius:50%}
.av-mouth{width:26px;height:12px;border-radius:0 0 13px 13px;background:#C0392B;position:relative;z-index:2}
.av-body{width:76px;height:62px;border-radius:12px 12px 0 0;position:absolute;bottom:0;left:50%;transform:translateX(-50%)}
.av-name-label{font-size:17px;font-weight:600}

.options-panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);padding:1.5rem}
.opt-group{margin-bottom:1.25rem}
.opt-group label{display:block;font-size:12px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;margin-bottom:8px}
.opt-group input,.opt-group select{width:100%;border:1px solid var(--border);border-radius:var(--rs);padding:10px 12px;font-size:14px;outline:none;font-family:inherit}
.opt-group input:focus,.opt-group select:focus{border-color:var(--purple)}
.swatches{display:flex;gap:8px;flex-wrap:wrap}
.swatch{width:30px;height:30px;border-radius:50%;cursor:pointer;border:3px solid transparent;transition:transform .15s,border-color .15s}
.swatch:hover{transform:scale(1.1)}
.swatch.active{border-color:var(--purple);transform:scale(1.15)}

/* ===== CHAT ===== */
.chat-page{display:flex;height:100vh;overflow:hidden}
.sidebar{width:250px;background:var(--surface);border-right:1px solid var(--border);display:flex;flex-direction:column;height:100vh;flex-shrink:0}
.sb-top{padding:1.25rem;display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--border)}
.sb-av{width:42px;height:42px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:700;flex-shrink:0}
.sb-avname{font-weight:600;font-size:14px}
.sb-username{color:var(--muted);font-size:12px}
.sb-nav{padding:.75rem;flex:1}
.nav-item{display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:var(--rs);font-size:14px;color:var(--muted);cursor:pointer;margin-bottom:2px;transition:background .15s,color .15s}
.nav-item:hover,.nav-item.active{background:var(--purple-l);color:var(--purple)}
.nav-item.active{font-weight:600}

.chat-main{flex:1;display:flex;flex-direction:column;height:100vh;overflow:hidden}
.chat-hdr{padding:.875rem 1.25rem;background:var(--surface);border-bottom:1px solid var(--border);display:flex;align-items:center;gap:10px;flex-shrink:0}
.menu-btn{background:none;border:none;font-size:20px;cursor:pointer;margin-right:2px;display:none}
@media(max-width:700px){.menu-btn{display:block}.sidebar{position:absolute;z-index:100;transform:translateX(-100%);transition:transform .25s}.sidebar.open{transform:translateX(0)}}
.hdr-av{width:38px;height:38px;border-radius:50%;position:relative;overflow:hidden;flex-shrink:0}
.hdr-hair{position:absolute;top:-2px;left:-2px;right:-2px;height:20px;border-radius:20px 20px 0 0}
.hdr-name{font-weight:600;font-size:15px}
.hdr-status{font-size:12px;color:var(--success)}
.hdr-actions{margin-left:auto;display:flex;gap:6px}
.icon-btn{background:none;border:1px solid var(--border);border-radius:var(--rs);padding:7px 11px;cursor:pointer;font-size:15px;transition:background .15s}
.icon-btn:hover{background:var(--purple-l)}

.msgs{flex:1;overflow-y:auto;padding:1.25rem;display:flex;flex-direction:column;gap:14px}
.msg{display:flex;gap:8px;max-width:78%}
.msg.user{flex-direction:row-reverse;align-self:flex-end}
.msg-av{width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:14px;color:#fff;flex-shrink:0}
.bubble{padding:11px 15px;border-radius:18px;font-size:15px;line-height:1.55}
.msg.avatar .bubble{background:var(--surface);border:1px solid var(--border);border-radius:4px 18px 18px 18px}
.msg.user   .bubble{background:var(--purple);color:#fff;border-radius:18px 4px 18px 18px}
.mtime{font-size:11px;color:var(--muted);margin-top:3px}
.bubble.typing{display:flex;gap:5px;padding:14px 18px;align-items:center}
.bubble.typing span{width:8px;height:8px;border-radius:50%;background:var(--muted);display:inline-block;animation:bounce 1.2s infinite}
.bubble.typing span:nth-child(2){animation-delay:.2s}
.bubble.typing span:nth-child(3){animation-delay:.4s}
@keyframes bounce{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-6px)}}

.input-area{padding:.875rem 1.25rem;background:var(--surface);border-top:1px solid var(--border);flex-shrink:0}
.input-row{display:flex;gap:8px;align-items:flex-end}
.input-row textarea{flex:1;border:1px solid var(--border);border-radius:var(--r);padding:11px 14px;font-size:15px;resize:none;outline:none;font-family:inherit;max-height:120px;transition:border .2s}
.input-row textarea:focus{border-color:var(--purple)}
.send-btn{width:42px;height:42px;background:var(--purple);color:#fff;border:none;border-radius:50%;cursor:pointer;font-size:16px;flex-shrink:0}
.send-btn:hover{background:var(--purple-d)}
.mic-btn{width:42px;height:42px;background:var(--surface);border:1px solid var(--border);border-radius:50%;cursor:pointer;font-size:16px;flex-shrink:0;transition:background .2s}
.mic-btn.active{background:var(--coral);color:#fff;border-color:var(--coral);animation:pulse 1s infinite}
@keyframes pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.07)}}
.input-hint{font-size:11px;color:var(--muted);margin-top:5px}

.crisis-bar{background:#FFF3CD;border:1px solid var(--warn);border-radius:var(--rs);padding:10px 14px;margin:0 1.25rem;font-size:13px;line-height:1.5;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-shrink:0}
.crisis-bar button{background:none;border:none;cursor:pointer;font-size:16px;flex-shrink:0}
.voice-bar{background:var(--purple-l);border:1px solid var(--purple);border-radius:var(--rs);padding:9px 14px;margin:0 1.25rem;font-size:13px;display:flex;align-items:center;gap:10px;flex-shrink:0}
.voice-bar button{background:none;border:1px solid var(--purple);border-radius:6px;padding:4px 10px;cursor:pointer;font-size:12px}
.pulse{width:10px;height:10px;border-radius:50%;background:var(--coral);animation:pulse .8s infinite;flex-shrink:0}

/* ===== WELLNESS ===== */
.wellness-page{display:flex;min-height:100vh}
.wellness-main{flex:1;padding:1.5rem;overflow-y:auto}
.well-hdr{display:flex;align-items:center;gap:10px;margin-bottom:1.5rem}
.well-hdr h2{font-size:22px;font-weight:700}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;margin-bottom:1.5rem}
.stat-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);padding:1.1rem}
.stat-label{font-size:11px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;margin-bottom:6px}
.stat-val{font-size:30px;font-weight:700;color:var(--purple)}
.stat-val small{font-size:14px;font-weight:400;color:var(--muted)}
.risk-low{color:var(--success)!important}
.risk-moderate{color:var(--warn)!important}
.risk-high{color:var(--danger)!important}
.section-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);padding:1.25rem;margin-bottom:1.25rem}
.section-card h3{font-size:15px;font-weight:600;margin-bottom:1rem}
.affirmation-item{padding:10px 0;border-bottom:1px solid var(--border);font-size:14px;line-height:1.5;display:flex;justify-content:space-between;gap:1rem}
.affirmation-item:last-child{border-bottom:none}
.aff-date{font-size:11px;color:var(--muted);white-space:nowrap;margin-top:2px}
.muted{color:var(--muted);font-size:14px}
.info-card{border-radius:var(--rs);padding:12px 16px;margin-bottom:1.25rem;font-size:14px}
.info-warn{background:#FFF3CD;border:1px solid var(--warn)}
