/* ===== RSA 0 FRAIS — VOICE ONLY ===== */

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

:root {
    --bg: #0a0e1a;
    --surface: rgba(255,255,255,0.04);
    --border: rgba(255,255,255,0.08);
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --accent-dark: #d97706;
    --accent-glow: rgba(245,158,11,0.35);
    --danger: #ef4444;
    --danger-glow: rgba(239,68,68,0.4);
    --info: #3b82f6;
    --info-glow: rgba(59,130,246,0.4);
    --green: #22c55e;
    --green-glow: rgba(34,197,94,0.4);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
}

html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Background */
.bg-gradient {
    position: fixed; inset: 0; z-index: -2;
    background: linear-gradient(145deg, #0a0e1a 0%, #111827 40%, #0f172a 70%, #0a0e1a 100%);
}
.bg-orbs { position: fixed; inset: 0; overflow: hidden; z-index: -1; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.12; animation: float 20s ease-in-out infinite; }
.orb-1 { width: 400px; height: 400px; background: var(--accent); top: -10%; right: -10%; }
.orb-2 { width: 350px; height: 350px; background: #8b5cf6; bottom: -10%; left: -10%; animation-delay: 5s; }
.orb-3 { width: 300px; height: 300px; background: var(--info); top: 40%; left: 30%; animation-delay: 10s; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(30px,-40px) scale(1.05); } 66% { transform: translate(-20px,30px) scale(0.95); } }

/* ===== Landing / Unlock ===== */
.audio-unlock {
    position: fixed; inset: 0; z-index: 1000;
    background: linear-gradient(145deg, #0a0e1a, #111827, #0a0e1a);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 20px;
}
.unlock-content { text-align: center; max-width: 400px; }
.unlock-logo { font-size: 5rem; display: block; margin-bottom: 20px; animation: bounce 2s ease-in-out infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.unlock-content h2 {
    font-size: 1.8rem; font-weight: 800; margin-bottom: 12px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.unlock-desc { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; margin-bottom: 16px; }
.unlock-features { list-style: none; text-align: left; margin: 20px auto; max-width: 320px; }
.unlock-features li { color: var(--text-muted); font-size: 0.85rem; padding: 6px 0; display: flex; align-items: center; gap: 10px; }
.unlock-features li::before { content: '✅'; font-size: 0.9rem; }
.unlock-btn {
    margin-top: 24px; padding: 16px 48px; font-size: 1.05rem; font-weight: 600;
    font-family: 'Inter', sans-serif; border: none; border-radius: 100px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #1a1206; cursor: pointer; box-shadow: 0 8px 32px var(--accent-glow);
    transition: all 0.3s ease;
}
.unlock-btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 12px 40px var(--accent-glow); }
.unlock-btn:active { transform: scale(0.98); }

/* ===== Voice App ===== */
.voice-app {
    display: flex; flex-direction: column; align-items: center;
    height: 100vh; height: 100dvh;
    max-width: 540px; margin: 0 auto; position: relative;
    padding: 20px;
}

/* Status bar */
.status-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; font-size: 0.8rem; color: var(--text-muted);
    margin-bottom: auto;
}
.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #64748b; transition: all 0.3s ease;
}
.status-dot.online { background: var(--green); box-shadow: 0 0 8px var(--green-glow); animation: blink 2s ease-in-out infinite; }
.status-dot.connecting { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); animation: blink 0.5s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Transcript area */
.transcript {
    flex: 1; width: 100%; overflow-y: auto; padding: 8px 4px;
    display: flex; flex-direction: column; gap: 10px;
    scrollbar-width: none; -ms-overflow-style: none;
}
.transcript::-webkit-scrollbar { display: none; }
.transcript-msg {
    max-width: 85%; padding: 12px 16px; border-radius: 18px;
    font-size: 0.9rem; line-height: 1.5; animation: msgIn 0.35s cubic-bezier(0.16,1,0.3,1);
}
@keyframes msgIn { from { opacity: 0; transform: translateY(15px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.transcript-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.transcript-msg.user { align-self: flex-end; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #1a1206; font-weight: 500; border-bottom-right-radius: 6px; }

/* ===== THE FACE ===== */
.face-container {
    position: relative; width: 180px; height: 180px;
    cursor: pointer; margin-bottom: 30px; margin-top: 20px;
    -webkit-tap-highlight-color: transparent;
}

.face-glow {
    position: absolute; inset: -20px; border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0; transition: opacity 0.4s ease;
}
.face-container.listening .face-glow {
    opacity: 1; background: radial-gradient(circle, var(--danger-glow) 0%, transparent 70%);
    animation: glow-pulse 1.2s ease-in-out infinite;
}
.face-container.speaking .face-glow {
    opacity: 1; animation: glow-pulse 0.6s ease-in-out infinite;
}
@keyframes glow-pulse { 0%,100% { transform: scale(1); opacity: 0.6; } 50% { transform: scale(1.15); opacity: 1; } }

/* Rings */
.face-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid var(--border); transition: all 0.4s ease;
}
.face-ring-2 { inset: 10px; }
.face-ring-3 { inset: 20px; }

.face-container.listening .face-ring { border-color: var(--danger); opacity: 0.4; }
.face-container.listening .face-ring-2 { border-color: var(--danger); opacity: 0.3; animation: ring-expand 1.5s ease-out infinite; }
.face-container.listening .face-ring-3 { border-color: var(--danger); opacity: 0.2; animation: ring-expand 1.5s ease-out infinite 0.5s; }
@keyframes ring-expand { 0% { transform: scale(0.95); opacity: 0.5; } 100% { transform: scale(1.2); opacity: 0; } }

.face-container.speaking .face-ring { border-color: var(--accent); opacity: 0.4; }
.face-container.speaking .face-ring-2 { border-color: var(--accent); opacity: 0.3; }
.face-container.speaking .face-ring-3 { border-color: var(--accent); opacity: 0.2; }

.face-container.idle .face-ring { border-color: var(--border); opacity: 0.3; }
.face-container.idle .face-ring-2 { border-color: var(--border); opacity: 0.15; }
.face-container.idle .face-ring-3 { opacity: 0; }

/* Face itself */
.face {
    position: absolute; inset: 30px; border-radius: 50%;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.4s ease;
}
.face-container.listening .face {
    border-color: var(--danger); box-shadow: inset 0 0 30px rgba(239,68,68,0.15), 0 0 40px var(--danger-glow);
}
.face-container.speaking .face {
    border-color: var(--accent); box-shadow: inset 0 0 30px var(--accent-glow), 0 0 40px var(--accent-glow);
    animation: face-talk 0.4s ease-in-out infinite alternate;
}
@keyframes face-talk { from { transform: scale(1); } to { transform: scale(1.04); } }

.face-emoji { font-size: 3rem; transition: all 0.3s ease; }
.face-container.listening .face-emoji { animation: mic-bounce 0.8s ease-in-out infinite; }
@keyframes mic-bounce { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }

/* Hint text */
.face-hint {
    text-align: center; color: var(--text-muted); font-size: 0.85rem;
    margin-bottom: 20px; transition: all 0.3s ease; min-height: 1.2em;
}

/* Typing indicator */
.typing { display: none; gap: 4px; align-items: center; justify-content: center; padding: 4px 0; }
.typing.active { display: flex; }
.typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: tdot 1.4s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
.typing span { color: var(--text-muted); font-size: 0.8rem; margin-left: 6px; }
@keyframes tdot { 0%,60%,100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-6px); opacity: 1; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; } }
