/* Aurien — JARVIS fullscreen, voice-first */

/* === LOGIN SCREEN === */
.login-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.login-orb {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 212, 255, 0.3);
  background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.1);
  animation: login-breathe 3s ease-in-out infinite;
}

@keyframes login-breathe {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.1); transform: scale(1); }
  50% { box-shadow: 0 0 40px rgba(0, 212, 255, 0.2); transform: scale(1.05); }
}

.login-label {
  font-size: 12px;
  letter-spacing: 6px;
  color: rgba(0, 212, 255, 0.4);
  text-transform: uppercase;
}

.pin-dots {
  display: flex;
  gap: 10px;
}

.pin-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 255, 0.25);
  background: transparent;
  transition: all 0.15s;
}

.pin-dots span.filled {
  background: rgba(0, 212, 255, 0.7);
  border-color: rgba(0, 212, 255, 0.7);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.pin-dots span.error {
  border-color: #ff3355;
  background: rgba(255, 51, 85, 0.5);
  box-shadow: 0 0 8px rgba(255, 51, 85, 0.4);
}

#pin-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.login-error {
  color: #ff3355;
  font-size: 12px;
  min-height: 16px;
  text-align: center;
}

.login-hint {
  color: rgba(255, 255, 255, 0.15);
  font-size: 11px;
  letter-spacing: 1px;
}

/* === TOTP SETUP === */
.totp-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.totp-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 320px;
  padding: 0 20px;
}

.totp-instruction {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}

.totp-qr {
  padding: 12px;
  background: #fff;
  border-radius: 8px;
}

.totp-qr img {
  width: 180px;
  height: 180px;
  display: block;
}

.totp-manual {
  color: rgba(0, 212, 255, 0.5);
  font-size: 10px;
  letter-spacing: 1px;
  word-break: break-all;
  text-align: center;
}

#totp-confirm-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(13, 19, 32, 0.8);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 8px;
  color: #e0e8f0;
  font-family: var(--font);
  font-size: 18px;
  text-align: center;
  letter-spacing: 8px;
}

#totp-confirm-input:focus {
  outline: none;
  border-color: rgba(0, 212, 255, 0.5);
}

.totp-confirm-btn {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 8px;
  background: rgba(0, 255, 136, 0.08);
  color: #00ff88;
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.totp-confirm-btn:hover {
  background: rgba(0, 255, 136, 0.15);
}

:root {
  --primary: #00d4ff;
  --accent: #00ff88;
  --danger: #ff3355;
  --warning: #ffaa00;
  --bg: #000000;
  --bg-card: #0a0f1a;
  --bg-input: #0d1320;
  --text: #e0e8f0;
  --text-dim: #5a6a7a;
  --border: #1a2535;
  --font: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.app {
  position: relative;
  height: 100%;
  width: 100%;
}

/* Top bar — settings + status dot */
.top-bar {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.btn-top {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(26, 37, 53, 0.4);
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-top:hover {
  border-color: rgba(0, 212, 255, 0.3);
  color: rgba(0, 212, 255, 0.6);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transition: background 0.3s;
}

.status-dot.error { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.status-dot.processing { background: var(--warning); box-shadow: 0 0 8px var(--warning); animation: pulse 1s ease-in-out infinite; }

/* Spectrum: 100% of screen */
.spectrum-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
}

.spectrum-container canvas {
  width: 100%;
  height: 100%;
}

/* Bottom bar — floating */
.bottom-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px 22px;
  z-index: 10;
}

.input-area {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 460px;
  width: 100%;
}

.input-area textarea {
  flex: 1;
  padding: 9px 12px;
  background: rgba(10, 15, 26, 0.75);
  border: 1px solid rgba(26, 37, 53, 0.6);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  line-height: 1.4;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.input-area textarea:focus {
  outline: none;
  border-color: rgba(0, 212, 255, 0.4);
}

.input-area textarea::placeholder { color: var(--text-dim); }

.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(26, 37, 53, 0.6);
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-icon:hover { border-color: var(--primary); color: var(--primary); }

.btn-icon.recording {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 255, 136, 0.1);
  box-shadow: 0 0 14px rgba(0, 255, 136, 0.25);
}

.btn-icon.muted {
  border-color: var(--text-dim);
  color: var(--text-dim);
  opacity: 0.35;
}

.btn-icon.send { border-color: rgba(0, 212, 255, 0.4); color: var(--primary); }

.btn-expand {
  padding: 6px 14px;
  border: 1px solid rgba(26, 37, 53, 0.6);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s;
}

.btn-expand:hover { border-color: var(--primary); color: var(--text); }

/* Chat overlay */
.chat-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.chat-overlay.open {
  transform: translateY(0);
  pointer-events: auto;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  flex-shrink: 0;
}

.chat-header span {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--primary);
  opacity: 0.5;
  text-transform: uppercase;
}

.btn-close-chat {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  cursor: pointer;
}

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.msg {
  padding: 10px 14px;
  border-radius: 10px;
  max-width: 85%;
  line-height: 1.5;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.user {
  align-self: flex-end;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(26, 37, 53, 0.6);
}

.msg.assistant {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid rgba(26, 37, 53, 0.6);
}

.msg.error {
  align-self: center;
  background: rgba(255, 51, 85, 0.08);
  border: 1px solid rgba(255, 51, 85, 0.25);
  color: var(--danger);
  font-size: 12px;
}

.msg.partial {
  opacity: 0.4;
  border-style: dashed;
  font-style: italic;
}

/* Plan card */
.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--warning);
  border-radius: 10px;
  padding: 14px;
}

.plan-card .plan-header {
  color: var(--warning);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.plan-card .plan-text {
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  margin-bottom: 14px;
  max-height: 200px;
  overflow-y: auto;
}

.plan-card .plan-actions { display: flex; gap: 8px; }

.plan-card input[type="text"] {
  flex: 1;
  padding: 7px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
}

.btn-approve {
  padding: 7px 14px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-family: var(--font);
  font-size: 11px;
  cursor: pointer;
}

.btn-reject {
  padding: 7px 10px;
  background: rgba(255, 51, 85, 0.06);
  border: 1px solid rgba(255, 51, 85, 0.3);
  border-radius: 6px;
  color: var(--danger);
  font-family: var(--font);
  font-size: 11px;
  cursor: pointer;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@supports (padding: env(safe-area-inset-bottom)) {
  .bottom-bar { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}

.chat::-webkit-scrollbar { width: 3px; }
.chat::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
