/* Aakhar Assistant — voice-first UI. Shares the Aakhar dark/glass language. */
:root {
  --bg: #07070c; --bg-2: #0c0c16;
  --surface: rgba(255,255,255,0.05); --surface-2: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.10); --border-strong: rgba(255,255,255,0.20);
  --text: #f4f4fb; --text-dim: #a6a6bd; --text-faint: #6b6b80;
  --accent: #7c5cff; --accent-2: #21d4fd; --accent-3: #b06bff; --ok: #3ddc97; --danger: #ff6b6b;
  --radius: 20px; --radius-sm: 13px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Sora", var(--font);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

.aurora { position: fixed; inset: 0; z-index: -3; overflow: hidden; background: radial-gradient(1200px 700px at 60% -10%, #1a1030 0%, transparent 60%), linear-gradient(180deg, var(--bg), var(--bg-2)); }
.aurora__blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45; mix-blend-mode: screen; }
.aurora__blob--1 { width: 48vw; height: 48vw; background: radial-gradient(circle, var(--accent), transparent 70%); top: -14vw; left: -6vw; animation: drift 22s ease-in-out infinite; }
.aurora__blob--2 { width: 42vw; height: 42vw; background: radial-gradient(circle, var(--accent-2), transparent 70%); bottom: 6vh; right: -12vw; animation: drift 26s ease-in-out infinite reverse; }
.aurora__blob--3 { width: 40vw; height: 40vw; background: radial-gradient(circle, var(--accent-3), transparent 70%); bottom: -16vw; left: 26vw; animation: drift 30s ease-in-out infinite; }
@keyframes drift { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(6vw,5vh) scale(1.12); } }

.center { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand__mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; font-family: var(--font-display); font-size: 21px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-3)); box-shadow: 0 8px 26px -8px var(--accent); }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand__name span { color: var(--text-dim); font-weight: 500; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 13px 22px; border-radius: 999px; font-size: 15px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: transform .2s, box-shadow .2s, opacity .2s; -webkit-tap-highlight-color: transparent; }
.btn--primary { color: #0b0b14; background: linear-gradient(135deg, #fff, #d9d4ff); box-shadow: 0 14px 40px -16px rgba(124,92,255,.8); }
.btn--primary:hover { transform: translateY(-2px); }
.btn--block { width: 100%; margin-top: 6px; }
.btn--sm { padding: 10px 16px; font-size: 14px; }
.iconbtn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; cursor: pointer; color: var(--text-dim); background: var(--surface); border: 1px solid var(--border); transition: color .2s, border-color .2s; }
.iconbtn:hover { color: var(--text); border-color: var(--border-strong); }

/* Login */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; }
.login__card { width: min(400px,100%); padding: 38px 32px 30px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(160deg, var(--surface-2), rgba(255,255,255,.012)); box-shadow: 0 30px 80px -30px rgba(0,0,0,.85); backdrop-filter: blur(14px); }
.login__brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.login__brand .brand__mark { width: 52px; height: 52px; font-size: 28px; border-radius: 15px; }
.login__title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.login__sub { color: var(--text-dim); font-size: .9rem; }
.login__error { margin-bottom: 14px; padding: 11px 14px; border-radius: var(--radius-sm); background: rgba(255,107,107,.10); border: 1px solid rgba(255,107,107,.3); color: #ffc9c9; font-size: 13.5px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 7px; }
.input { width: 100%; padding: 13px 15px; border-radius: var(--radius-sm); background: rgba(255,255,255,.04); border: 1px solid var(--border); color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124,92,255,.12); }

/* Assistant shell */
.asst { height: 100dvh; display: grid; grid-template-rows: auto auto 1fr auto auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.topbar__right { display: flex; align-items: center; gap: 12px; }
.topbar__user { font-size: 13px; color: var(--text-dim); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); box-shadow: 0 0 0 0 transparent; }
.dot--ok { background: var(--ok); box-shadow: 0 0 10px 1px rgba(61,220,151,.7); }
.dot--off { background: var(--danger); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 18px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; font-size: 13px; white-space: nowrap; cursor: pointer; color: var(--text-dim); background: var(--surface); border: 1px solid var(--border); transition: color .2s, border-color .2s, background .2s; }
.chip:hover { color: var(--text); border-color: var(--accent); background: rgba(124,92,255,.10); }

.stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 10px 22px; text-align: center; min-height: 0; overflow-y: auto; }
.greeting { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 4vw, 2rem); letter-spacing: -.02em; }
.status { color: var(--text-dim); font-size: 15px; letter-spacing: .06em; text-transform: uppercase; min-height: 1.2em; }

/* The orb */
.orb { position: relative; width: min(56vw, 260px); height: min(56vw, 260px); border: none; background: none; cursor: pointer; display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.orb__glow { position: absolute; inset: -18%; border-radius: 50%; background: radial-gradient(circle at 50% 45%, rgba(176,107,255,.55), rgba(124,92,255,.28) 45%, transparent 70%); filter: blur(18px); animation: breathe 4s ease-in-out infinite; }
.orb__core { position: absolute; width: 46%; height: 46%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff 0%, #c9b8ff 25%, var(--accent) 60%, #5a3ff0 100%); box-shadow: 0 0 60px -6px var(--accent), inset 0 0 40px rgba(255,255,255,.4); animation: breathe 4s ease-in-out infinite; }
.orb__ring { position: absolute; border-radius: 50%; border: 1.5px solid rgba(176,107,255,.22); }
.orb__ring--1 { inset: 6%; border-color: rgba(176,107,255,.28); animation: spin 14s linear infinite; border-top-color: rgba(255,255,255,.55); }
.orb__ring--2 { inset: 18%; animation: spin 9s linear infinite reverse; border-top-color: rgba(33,212,253,.5); }
.orb__ring--3 { inset: 30%; animation: spin 6s linear infinite; border-left-color: rgba(255,255,255,.4); }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.06); opacity: 1; } }

.orb.is-listening .orb__glow, .orb.is-listening .orb__core { animation-duration: 1.1s; }
.orb.is-listening .orb__glow { background: radial-gradient(circle at 50% 45%, rgba(33,212,253,.6), rgba(124,92,255,.3) 45%, transparent 70%); }
.orb.is-thinking .orb__ring { animation-duration: 1.6s; }
.orb.is-thinking .orb__core { animation: pulseFast 1s ease-in-out infinite; }
.orb.is-speaking .orb__core { animation: pulseFast 1.6s ease-in-out infinite; }
.orb.is-speaking .orb__glow { background: radial-gradient(circle at 50% 45%, rgba(61,220,151,.5), rgba(124,92,255,.28) 45%, transparent 70%); }
@keyframes pulseFast { 0%,100% { transform: scale(.98); } 50% { transform: scale(1.12); } }

.transcript { min-height: 1.4em; color: var(--text); font-size: clamp(1rem, 3.4vw, 1.25rem); max-width: 680px; }
.transcript:empty { display: none; }
.answer { color: var(--text); font-size: clamp(1rem, 3.6vw, 1.3rem); line-height: 1.55; max-width: 720px; }
.answer:empty { display: none; }
.source { font-size: 12px; color: var(--text-faint); display: inline-flex; align-items: center; gap: 6px; }
.source .tag { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); }
.source .tag--local { color: #9fe6c4; border-color: rgba(61,220,151,.3); background: rgba(61,220,151,.08); }
.source .tag--copilot { color: #cdbcff; border-color: rgba(124,92,255,.3); background: rgba(124,92,255,.10); }

/* Text input bar */
.textbar { display: flex; gap: 8px; padding: 8px 18px; max-width: 720px; margin: 0 auto; width: 100%; }
.textbar__input { flex: 1; padding: 12px 16px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--text); outline: none; }
.textbar__input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124,92,255,.12); }

/* Controls */
.controls { display: flex; align-items: center; justify-content: center; gap: 26px; padding: 14px 18px calc(18px + env(safe-area-inset-bottom)); }
.ctrl { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; color: var(--text-dim); background: var(--surface); border: 1px solid var(--border); transition: color .2s, border-color .2s; }
.ctrl:hover { color: var(--text); border-color: var(--border-strong); }
.mic { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; cursor: pointer; color: #fff; border: none; background: linear-gradient(135deg, var(--accent), var(--accent-3)); box-shadow: 0 14px 40px -10px var(--accent); transition: transform .15s; -webkit-tap-highlight-color: transparent; }
.mic:hover { transform: translateY(-2px); }
.mic:active { transform: scale(.95); }
.mic.is-on { animation: micpulse 1.2s ease-in-out infinite; }
@keyframes micpulse { 0%,100% { box-shadow: 0 14px 40px -10px var(--accent), 0 0 0 0 rgba(124,92,255,.5); } 50% { box-shadow: 0 14px 40px -10px var(--accent), 0 0 0 16px rgba(124,92,255,0); } }
