/*
 * app.css — Vrinda AI's own pieces: the calm ground, the sidebar and phone
 * drawer, the quote band, the practice tiles, the wizard option cards, the
 * chat, the progress rings and calendar, and the EFT tapping figure.
 * Tokens only; the colours live in theme.css.
 */

/* ---- Ground & brand ----------------------------------------------------- */
.ground { background-image: var(--gradient-aurora); background-attachment: fixed; background-repeat: no-repeat; }
.brand-mark { display: inline-grid; place-items: center; flex-shrink: 0; background: var(--gradient-brand); color: var(--accent-ink); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.text-gold { color: var(--x-gold); }
.text-gold-strong { color: var(--x-gold-strong); }
.bg-gold-soft { background-color: var(--x-gold-soft); }
.text-lavender { color: var(--x-lavender); }
.eyebrow { font-size: 0.72rem; font-weight: 600; letter-spacing: var(--eyebrow-tracking, 0.08em); text-transform: uppercase; opacity: 0.8; }
.font-display { font-family: var(--font-display); letter-spacing: var(--display-tracking, 0); }

.btn-gold { background: var(--x-gold); border-color: var(--x-gold); color: var(--x-band); }
.btn-gold:hover { background: color-mix(in srgb, var(--x-gold) 85%, var(--x-band)); border-color: color-mix(in srgb, var(--x-gold) 85%, var(--x-band)); }
.is-fav { color: var(--danger-strong); }
.is-fav .icon { fill: currentColor; }

/* ---- App shell ---------------------------------------------------------- */
.sidebar { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(12px); }
aside.sidebar { position: sticky; top: 0; height: 100vh; }
.topbar { background: color-mix(in srgb, var(--canvas) 88%, transparent); backdrop-filter: blur(12px); }
.nav-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.85rem; border-radius: 0.85rem; color: var(--muted); font-size: 0.92rem; font-weight: 500; text-decoration: none; transition: background-color 150ms, color 150ms; background: transparent; border: 0; cursor: pointer; text-align: left; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.nav-link-admin { color: var(--x-lavender-strong); }
.nav-link-admin:hover { background: var(--x-lavender-soft); color: var(--x-lavender-strong); }

.drawer { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.drawer-scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 45%, transparent); opacity: 0; transition: opacity 200ms; }
.drawer-panel { position: absolute; inset-block: 0; left: 0; width: min(18rem, 86vw); background: var(--surface); border-right: 1px solid var(--border); transform: translateX(-100%); transition: transform 260ms var(--ease-out, ease-out); box-shadow: var(--shadow-raised); }
.navopen:checked ~ .drawer { pointer-events: auto; }
.navopen:checked ~ .drawer .drawer-scrim { opacity: 1; }
.navopen:checked ~ .drawer .drawer-panel { transform: none; }

/* Segmented switch (sign in / sign up, language). */
.seg { display: inline-flex; gap: 0.25rem; padding: 0.25rem; border-radius: 999px; background: var(--surface-2); }
.seg-item { display: inline-flex; align-items: center; justify-content: center; flex: 1; padding: 0.45rem 1rem; border-radius: 999px; font-size: 0.875rem; font-weight: 500; color: var(--muted); text-decoration: none; background: transparent; border: 0; cursor: pointer; white-space: nowrap; }
.seg-item:hover { color: var(--ink); text-decoration: none; }
.seg-item.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); font-weight: 600; }
.card > .seg { display: flex; }
.seg-sm .seg-item { padding: 0.25rem 0.7rem; font-size: 0.78rem; }

.ai-link { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; font-weight: 600; color: var(--accent-text); background: none; border: 0; padding: 0; cursor: pointer; }
.ai-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.ai-link.htmx-request { opacity: 0.6; pointer-events: none; }
.ai-link.htmx-request .icon { animation: spin 900ms linear infinite; }

/* ---- Landing ------------------------------------------------------------ */
.landing-bar { background: color-mix(in srgb, var(--canvas) 85%, transparent); backdrop-filter: blur(12px); }
.hero-ground { background-image: var(--gradient-aurora); }
.hero-chat { box-shadow: var(--shadow-raised); }
.float-chip { position: absolute; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-radius: 1rem; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-raised); }
.float-chip-a { left: -1.5rem; bottom: -1.5rem; }
.float-chip-b { right: -1rem; top: -1.25rem; }
.band-tint { background: var(--surface-2); }
.band-dark { background: var(--x-band); color: var(--x-band-ink); }
.band-muted { color: var(--x-band-muted); }
.band-card { background: color-mix(in srgb, var(--x-band-ink) 7%, transparent); border: 1px solid color-mix(in srgb, var(--x-band-ink) 14%, transparent); }
.step-num { font-size: 3.5rem; line-height: 1; color: color-mix(in srgb, var(--accent) 40%, transparent); }

.bubble { padding: 0.75rem 1rem; border-radius: 1.15rem; font-size: 0.9rem; line-height: 1.55; }
.bubble-user { align-self: flex-end; margin-left: auto; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 0.35rem; max-width: 85%; }
.bubble-ai { align-self: flex-start; background: var(--surface-2); color: var(--ink); border-bottom-left-radius: 0.35rem; max-width: 85%; }
.bubble-typing { display: inline-flex; gap: 0.3rem; align-items: center; }
.bubble-typing span { width: 0.4rem; height: 0.4rem; border-radius: 999px; background: currentColor; opacity: 0.5; animation: typing 1s infinite ease-in-out; }
.bubble-typing span:nth-child(2) { animation-delay: 150ms; }
.bubble-typing span:nth-child(3) { animation-delay: 300ms; }
@keyframes typing { 0%, 100% { transform: translateY(0); opacity: 0.35; } 50% { transform: translateY(-3px); opacity: 0.9; } }

/* ---- Dashboard & shared tiles ------------------------------------------ */
.quote-card { background: var(--gradient-brand); color: var(--accent-ink); box-shadow: 0 20px 40px -24px color-mix(in srgb, var(--accent) 80%, transparent); }
.stat-tile .icon { width: 1.35rem; height: 1.35rem; }
.usage-card { color: inherit; transition: border-color 150ms, transform 150ms; }
.usage-card:hover { border-color: var(--accent-border); transform: translateY(-1px); text-decoration: none; }
.quick-action { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; padding: 1.25rem; border-radius: var(--radius-card); border: 1px solid var(--border); background: var(--surface); transition: border-color 150ms, transform 150ms; }
.quick-action:hover { border-color: var(--accent-border); transform: translateY(-2px); text-decoration: none; }
.stat { display: flex; flex-direction: column; gap: 0.5rem; }
.stat > * + * { margin-top: 0; }
.stat-label { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.stat-value { font-family: var(--font-display); font-size: 2rem; line-height: 1.1; }

/* ---- Planner ------------------------------------------------------------ */
.planner-track { height: 0.6rem; border-radius: 999px; background: color-mix(in srgb, var(--accent-ink) 22%, transparent); overflow: hidden; }
.planner-fill { height: 100%; border-radius: inherit; background: var(--x-gold); transition: width 400ms var(--ease-out, ease-out); }
.practice-tile { display: block; width: 100%; text-align: left; padding: 1.35rem; border-radius: var(--radius-card); border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: border-color 150ms, background-color 150ms, transform 150ms; color: var(--ink); }
.practice-tile:hover { border-color: var(--accent-border); transform: translateY(-1px); }
.practice-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 0.9rem; background: var(--accent-soft); color: var(--accent-strong); }
.practice-check { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 999px; border: 2px solid var(--border-strong); color: transparent; transition: all 150ms; }
.practice-tile.is-done { background: var(--accent-soft); border-color: var(--accent-border); }
.practice-tile.is-done .practice-icon { background: var(--accent); color: var(--accent-ink); }
.practice-tile.is-done .practice-check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.practice-tile.htmx-request { opacity: 0.7; }

/* ---- Progress ----------------------------------------------------------- */
.ring-track { stroke: color-mix(in srgb, currentColor 18%, transparent); }
.ring-value { stroke: var(--x-gold); transition: stroke-dashoffset 600ms var(--ease-out, ease-out); }
.card .ring-value { stroke: var(--accent); }
.card .ring-track { stroke: var(--surface-2); }
.cal-day { display: grid; place-items: center; aspect-ratio: 1; border-radius: 0.6rem; font-size: 0.75rem; font-weight: 500; background: var(--surface-2); color: var(--muted); }
.cal-day.lvl-1 { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--ink); }
.cal-day.lvl-2 { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); color: var(--ink); }
.cal-day.lvl-3 { background: color-mix(in srgb, var(--accent) 72%, var(--surface)); color: var(--accent-ink); }
.cal-day.lvl-4 { background: var(--accent); color: var(--accent-ink); }
.cal-day.is-today { outline: 2px solid var(--x-gold); outline-offset: 1px; }
.cal-day.is-future { opacity: 0.45; }
.badge-tile { padding: 1rem; border-radius: 1rem; border: 1px dashed var(--border-strong); background: var(--surface); opacity: 0.7; }
.badge-tile.is-earned { border-style: solid; border-color: var(--x-gold); background: var(--x-gold-soft); opacity: 1; }
.badge-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 0.8rem; background: var(--surface-2); color: var(--muted); }
.badge-tile.is-earned .badge-icon { background: var(--x-gold); color: var(--x-band); }
.podium { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.25rem 0.75rem; border-radius: var(--radius-card); border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.podium-1 { border-color: var(--x-gold); background: var(--x-gold-soft); color: var(--x-gold-strong); }
.podium-1 .avatar { background: var(--x-gold); color: var(--x-band); }
.podium-2 { color: var(--muted); }
.podium-3 { color: var(--x-gold-strong); }
.podium p { color: var(--ink); }

/* ---- Wizard & option cards (Ho'oponopono, EFT) -------------------------- */
.wizard-dots { display: flex; gap: 0.4rem; }
.wizard-dots span { height: 0.35rem; flex: 1; border-radius: 999px; background: var(--surface-2); transition: background-color 200ms; }
.wizard-dots span.is-done { background: var(--accent); }
.wizard-step > * + * { margin-top: 1.25rem; }
.option-card { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 3.25rem; padding: 0.8rem 1rem; border-radius: 1rem; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-size: 0.92rem; font-weight: 500; transition: border-color 150ms, background-color 150ms; }
.option-card:hover { border-color: var(--accent); }
.option-check { display: grid; place-items: center; width: 1.35rem; height: 1.35rem; flex-shrink: 0; border-radius: 999px; border: 2px solid var(--border-strong); color: transparent; }
.option-check .icon { width: 0.8rem; height: 0.8rem; }
.option-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.option-card:has(input:checked) .option-check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.option-card:has(input:focus-visible) { box-shadow: var(--ring); }
.option-card:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }

.choice { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.85rem; border-radius: 1rem; border: 1px solid var(--border-strong); cursor: pointer; font-weight: 500; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.prompt-option { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.7rem 0.9rem; border-radius: 0.9rem; border: 1px solid var(--border); cursor: pointer; font-size: 0.9rem; }
.prompt-option:hover { border-color: var(--x-gold); }
.prompt-option:has(input:checked) { border-color: var(--x-gold); background: var(--x-gold-soft); color: var(--x-gold-strong); }

.gen-item { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; width: 100%; padding: 0.8rem 1rem; border-radius: 1rem; border: 1px solid var(--border); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; transition: border-color 150ms, background-color 150ms; }
.gen-item:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.gen-item:disabled { opacity: 0.5; cursor: not-allowed; }
.gen-item.is-saved { border-color: var(--success); background: var(--success-soft); color: var(--success-strong); cursor: default; }

.action-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; min-height: 5.5rem; padding: 1rem; border-radius: 1rem; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: border-color 150ms, background-color 150ms; }
.action-tile .icon { width: 1.25rem; height: 1.25rem; color: var(--accent-text); }
.action-tile:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.action-tile:disabled { opacity: 0.5; cursor: not-allowed; }
.action-tile.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }

.wait-overlay { position: fixed; inset: 0; z-index: 70; display: none; place-items: center; padding: 1.5rem; background: color-mix(in srgb, var(--canvas) 78%, transparent); backdrop-filter: blur(6px); }
.wait-overlay.htmx-request { display: grid; }
.breathe { animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.script-text { display: flex; flex-direction: column; gap: 0.9rem; line-height: 1.75; }
.script-text h3 { margin-top: 0.75rem; }
.saved-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1.25rem; border-top: 1px solid var(--border); color: inherit; }
.saved-row:hover { background: var(--surface-2); text-decoration: none; }

/* ---- Vision board ------------------------------------------------------- */
.vision-card { position: relative; }
.vision-actions { position: absolute; top: 0.6rem; right: 0.6rem; display: flex; gap: 0.35rem; opacity: 0; transition: opacity 150ms; }
.vision-card:hover .vision-actions, .vision-card:focus-within .vision-actions { opacity: 1; }
@media (hover: none) { .vision-actions { opacity: 1; } }
.upload-zone { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 1.5rem; border: 2px dashed var(--border-strong); border-radius: 1rem; text-align: center; cursor: pointer; color: var(--muted); transition: border-color 150ms, background-color 150ms; }
.upload-zone:hover, .upload-zone:focus-within { border-color: var(--accent); background: var(--accent-soft); }

/* ---- Chat ----------------------------------------------------------------- */
.chat-panel { height: calc(100vh - 13rem); min-height: 28rem; }
@media (min-width: 1024px) { .chat-panel { height: calc(100vh - 12rem); } }
.chat-input { max-height: 10rem; }

/* ---- Admin ---------------------------------------------------------------- */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.admin-tabs .chip { text-decoration: none; }
.checkbox { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); cursor: pointer; }
.switch { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }

/* ---- EFT ------------------------------------------------------------------ */
.range { width: 100%; accent-color: var(--accent); height: 1.5rem; cursor: pointer; }
.intensity { display: flex; flex-direction: column; gap: 0.75rem; }
.intensity-value { font-size: 3.25rem; line-height: 1; color: var(--accent-text); text-align: center; }
.script-editor { font-size: 0.92rem; line-height: 1.6; min-height: 22rem; }
.eft-figure-wrap { display: grid; place-items: center; padding: 1rem; border-radius: var(--radius-card); background: var(--surface-2); }
.eft-figure { width: 100%; max-width: 15rem; height: auto; }
.eft-skin { fill: var(--x-skin); stroke: var(--x-skin-line); stroke-width: 2; }
.eft-line { fill: none; stroke: var(--x-hair); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.eft-ink { fill: var(--x-hair); }
.eft-dot { fill: var(--x-gold); stroke: var(--x-band); stroke-width: 2; }
.eft-ring { fill: none; stroke: var(--x-gold); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: tap-pulse 1.1s ease-out infinite; }
@keyframes tap-pulse { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.eft-statement { margin: 1.25rem 0 0.75rem; padding: 1rem 1.25rem; border-left: 3px solid var(--x-gold); border-radius: 0 1rem 1rem 0; background: var(--x-gold-soft); color: var(--ink); font-size: 1.3rem; line-height: 1.45; }
.eft-step:not([hidden]) { animation: fade-up 280ms var(--ease-out, ease-out) both; }

/* ---- Motion: nothing moves for people who asked for less --------------- */
html.reduced-motion .breathe, html.reduced-motion .eft-ring, html.reduced-motion .bubble-typing span,
html.reduced-motion .eft-step, html.reduced-motion .ai-link .icon { animation: none !important; }
html.reduced-motion .drawer-panel, html.reduced-motion .practice-tile, html.reduced-motion .quick-action { transition: none !important; }
