/* ============================================================
   GreenVoice Demo — Styles
   Matches the Shopify theme glassmorphism aesthetic
   ============================================================ */

:root {
  --bg: #0a0f1a;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);
  --accent: #22c55e;
  --accent-dim: rgba(34,197,94,0.15);
  --accent-glow: rgba(34,197,94,0.3);
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(255,255,255,0.08);
  --border-accent: rgba(34,197,94,0.3);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --font: 'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(34,197,94,0.08) 0%, transparent 60%),
    radial-gradient(circle at 20% 80%, rgba(34,197,94,0.04) 0%, transparent 40%);
}

/* ── Layout ──────────────────────────────────── */
.page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem; }
.card {
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  animation: cardIn 0.5s ease-out;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Typography ──────────────────────────────── */
.logo { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 2rem; }
.logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #16a34a);
  display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { width: 20px; height: 20px; color: white; }
.logo-text { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; }
.logo-text .g { color: var(--accent); }

.card h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.5rem; line-height: 1.2; }
.card .subtitle { font-size: 0.88rem; color: var(--text-dim); line-height: 1.5; margin-bottom: 2rem; }
.card .subtitle strong { color: var(--accent); font-weight: 600; }

/* ── Auth Buttons ────────────────────────────── */
.auth-buttons { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }

.btn-auth {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  width: 100%; padding: 0.85rem 1.25rem;
  font-family: var(--font); font-size: 0.9rem; font-weight: 600;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text);
  cursor: pointer; transition: all var(--transition);
  text-decoration: none;
}
.btn-auth:hover { background: var(--bg-card-hover); border-color: rgba(255,255,255,0.15); transform: translateY(-1px); }
.btn-auth:active { transform: translateY(0); }
.btn-auth svg, .btn-auth img { width: 20px; height: 20px; flex-shrink: 0; }

.btn-auth--google { background: white; color: #1f2937; border-color: rgba(0,0,0,0.1); }
.btn-auth--google:hover { background: #f8fafc; }

.btn-auth--apple { background: white; color: #000; border-color: rgba(0,0,0,0.1); }
.btn-auth--apple:hover { background: #f8fafc; }

/* ── Divider ─────────────────────────────────── */
.divider { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.divider span { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }

/* ── Input Fields ────────────────────────────── */
.input-group { margin-bottom: 1rem; }
.input-group label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-dim); margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.06em; }
.input-row { display: flex; gap: 0.5rem; }

.input-field {
  width: 100%; padding: 0.8rem 1rem;
  font-family: var(--font); font-size: 0.9rem;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text);
  transition: border-color var(--transition);
  outline: none;
}
.input-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.input-field::placeholder { color: var(--text-muted); }

.btn-send {
  padding: 0.8rem 1.25rem;
  background: var(--accent); color: white; border: none;
  border-radius: var(--radius-xs); font-family: var(--font);
  font-size: 0.85rem; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: all var(--transition);
}
.btn-send:hover { background: #16a34a; }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Primary CTA ─────────────────────────────── */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 0.9rem;
  background: linear-gradient(135deg, var(--accent), #16a34a);
  color: white; border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none;
}
.btn-primary:hover { box-shadow: 0 4px 24px var(--accent-glow); transform: translateY(-1px); }

/* ── Footer Note ─────────────────────────────── */
.footer-note { text-align: center; font-size: 0.75rem; color: var(--text-muted); margin-top: 1.5rem; line-height: 1.5; }
.footer-note a { color: var(--text-dim); text-decoration: underline; }

/* ── States ──────────────────────────────────── */
.hidden { display: none !important; }
.loading { pointer-events: none; opacity: 0.6; }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: white;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-msg {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5; padding: 0.75rem 1rem; border-radius: var(--radius-xs);
  font-size: 0.82rem; margin-bottom: 1rem;
}

.success-msg {
  background: var(--accent-dim); border: 1px solid var(--border-accent);
  color: var(--accent); padding: 0.75rem 1rem; border-radius: var(--radius-xs);
  font-size: 0.82rem; margin-bottom: 1rem;
}

/* ── Trial Badge ─────────────────────────────── */
.trial-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--accent-dim); border: 1px solid var(--border-accent);
  padding: 0.35rem 0.75rem; border-radius: 100px;
  font-size: 0.75rem; font-weight: 700; color: var(--accent);
  margin-bottom: 1.5rem;
}

/* ============================================================
   DEMO INTERFACE (demo.html)
   ============================================================ */
.demo-page {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  max-width: 480px; margin: 0 auto;
  padding: 0;
}

.demo-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.demo-header .logo { margin: 0; }
.demo-status {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; color: var(--text-dim);
}
.demo-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted);
}
.demo-status .dot.live { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); animation: pulse 2s infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 4px var(--accent-glow); }
  50% { box-shadow: 0 0 16px var(--accent-glow); }
}

/* ── Voice Visualizer ────────────────────────── */
.demo-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; gap: 2rem; }

.voice-orb-container { position: relative; width: 200px; height: 200px; }

.voice-orb {
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(34,197,94,0.3), rgba(34,197,94,0.05));
  border: 2px solid var(--border-accent);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}
.voice-orb.speaking {
  border-color: var(--accent);
  box-shadow: 0 0 60px var(--accent-glow), 0 0 120px rgba(34,197,94,0.1);
  animation: orbPulse 1.5s ease-in-out infinite;
}
.voice-orb.listening {
  border-color: rgba(96,165,250,0.5);
  box-shadow: 0 0 40px rgba(96,165,250,0.2);
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.voice-orb svg { width: 48px; height: 48px; color: var(--accent); opacity: 0.8; }

.voice-label { font-size: 0.85rem; color: var(--text-dim); text-align: center; }
.voice-label strong { color: var(--text); }

/* ── Transcript Area ─────────────────────────── */
.transcript {
  width: 100%; max-height: 200px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 0 0.5rem;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.transcript-line { font-size: 0.82rem; line-height: 1.5; padding: 0.5rem 0.75rem; border-radius: var(--radius-xs); }
.transcript-line.ai { color: var(--accent); background: var(--accent-dim); }
.transcript-line.user { color: var(--text-dim); background: rgba(255,255,255,0.03); }
.transcript-line .speaker { font-weight: 700; margin-right: 0.4rem; }

/* ── Demo Footer Controls ────────────────────── */
.demo-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}

.btn-mic {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #16a34a);
  border: none; color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-mic:hover { transform: scale(1.05); box-shadow: 0 4px 32px var(--accent-glow); }
.btn-mic:active { transform: scale(0.97); }
.btn-mic.active { background: #ef4444; box-shadow: 0 4px 20px rgba(239,68,68,0.3); animation: none; }
.btn-mic svg { width: 24px; height: 24px; }

.btn-end {
  padding: 0.6rem 1.25rem;
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5; border-radius: var(--radius-xs);
  font-family: var(--font); font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.btn-end:hover { background: rgba(239,68,68,0.2); }

.usage-bar {
  width: 120px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden;
}
.usage-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.5s ease; }
.usage-text { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ── Profile Prompt (non-blocking) ───────────── */
.profile-prompt {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(15,23,42,0.95); backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem; display: flex; align-items: center; gap: 1rem;
  animation: slideUp 0.3s ease-out;
  z-index: 100;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.profile-prompt p { flex: 1; font-size: 0.82rem; color: var(--text-dim); }
.profile-prompt .btn-send { padding: 0.5rem 1rem; font-size: 0.78rem; }
.profile-prompt .btn-dismiss {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.78rem; padding: 0.5rem;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 480px) {
  .card { padding: 2rem 1.5rem; border-radius: var(--radius-sm); }
  .demo-body { padding: 1.5rem; }
  .voice-orb-container { width: 160px; height: 160px; }
  .voice-orb { width: 160px; height: 160px; }
}
