/* PA Voice PWA — minimal dark iOS-feel */

:root {
  --bg: #0a0a0f;
  --bg-panel: #14141c;
  --bg-input: #1d1d27;
  --fg: #e7e7ee;
  --fg-muted: #8a8a99;
  --fg-dim: #555563;
  --accent: #7c5cff;
  --accent-active: #9a80ff;
  --error: #ff5c7c;
  --ok: #4ad48c;
  --radius: 18px;
  --radius-sm: 12px;
  --stroke: 1px solid #22222d;
  --shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  display: flex;
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 720px;
  margin: 0 auto;
  padding: calc(16px + var(--safe-top)) 20px calc(16px + var(--safe-bottom)) 20px;
  min-height: 100dvh;
}

/* Header */
.hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.logo {
  font-size: 28px;
  margin: 0;
  letter-spacing: 0.02em;
  font-weight: 700;
  color: var(--fg);
}
.text-btn {
  background: transparent;
  border: none;
  color: var(--fg-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 6px 10px;
}
.text-btn:hover { color: var(--fg); }

/* Views */
.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hidden { display: none !important; }

/* Panel (login) */
.panel {
  background: var(--bg-panel);
  border-radius: var(--radius);
  padding: 28px 24px;
  border: var(--stroke);
  text-align: center;
  box-shadow: var(--shadow);
  margin-top: 14vh;
}
.panel h2 { margin: 0 0 12px 0; font-weight: 600; }
.muted { color: var(--fg-muted); }
.error { color: var(--error); margin-top: 12px; }

/* Buttons */
.primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 22px;
  cursor: pointer;
  margin-top: 20px;
  transition: transform 0.1s ease, background 0.15s ease;
}
.primary:active { transform: scale(0.97); background: var(--accent-active); }

/* Voice view */
.transcript-wrap {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-panel);
  border: var(--stroke);
  min-height: 80px;
}
.transcript {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.transcript.live { color: var(--fg); }

.answer-wrap {
  flex: 1;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--bg-input);
  border: var(--stroke);
  overflow-y: auto;
  min-height: 120px;
}
.status {
  font-size: 14px;
  margin-bottom: 8px;
  font-style: italic;
}
.answer {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 17px;
}

/* Mic */
.mic-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 0 8px;
}
.mic {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(124, 92, 255, 0.3);
  transition: transform 0.1s ease, background 0.2s ease;
}
.mic:active { transform: scale(0.94); }
.mic.recording {
  background: var(--error);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 92, 124, 0.5); }
  50%       { box-shadow: 0 0 0 16px rgba(255, 92, 124, 0); }
}

.cancel {
  background: transparent;
  color: var(--fg-muted);
  border: none;
  font-size: 15px;
  cursor: pointer;
  padding: 8px 14px;
}

.ftr {
  text-align: center;
  font-size: 12px;
  margin-top: 10px;
}
