/*
  SpeakUp — estilos del shell (E04).
  Mínimos, legibles y de alto contraste para uso en el auto (teléfono montado).
  Botón grande, paleta oscura (navy) para no encandilar de noche, tipografía
  amplia. Sin frameworks (D3).
*/

:root {
  --bg: #0f172a; /* navy oscuro */
  --bg-elev: #1e293b;
  --fg: #f8fafc;
  --fg-muted: #94a3b8;
  --accent: #22d3ee; /* cyan */
  --ok: #22c55e;
  --warn: #f59e0b;
  --error: #ef4444;
  --speaking: #a78bfa;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.25rem
    max(1.5rem, env(safe-area-inset-bottom));
}

.app__header {
  text-align: center;
  margin-top: 1rem;
}

.app__title {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.02em;
}

/* Indicador de estado: el color comunica de un vistazo, sin leer. */
.status {
  margin: 0.5rem 0 0;
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--fg-muted);
}

.status--idle {
  color: var(--fg-muted);
}
.status--connecting {
  color: var(--warn);
}
.status--listening {
  color: var(--ok);
}
.status--speaking {
  color: var(--speaking);
}
.status--error {
  color: var(--error);
}

/* Botón principal: ocupa el centro, grande, fácil de acertar conduciendo. */
.start-button {
  width: min(70vw, 16rem);
  aspect-ratio: 1 / 1;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #06121a;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.6);
  transition: transform 0.1s ease, box-shadow 0.3s ease, background 0.2s ease;
}

.start-button:active {
  transform: scale(0.97);
}

.start-button[aria-pressed="true"] {
  background: var(--error);
  color: var(--fg);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }
  50% {
    box-shadow: 0 0 0 18px rgba(239, 68, 68, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .start-button[aria-pressed="true"] {
    animation: none;
  }
}

/* Vistazo a "qué hay hoy" / resumen. */
.glance {
  width: 100%;
  max-width: 32rem;
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.glance__heading {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.glance__body {
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--fg);
  white-space: pre-wrap;
}

/* Configuración (secreto compartido + API base): plegada por defecto. */
.config {
  width: 100%;
  max-width: 32rem;
  margin-top: auto;
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 0.5rem 1.25rem;
}

.config__summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--fg-muted);
  padding: 0.5rem 0;
}

.config__label {
  display: block;
  margin: 0.75rem 0 0.25rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.config__input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0b1220;
  color: var(--fg);
  font-size: 1rem;
}

.config__save {
  margin: 0.9rem 0 0.5rem;
  padding: 0.65rem 1.2rem;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #06121a;
  font-weight: 700;
  cursor: pointer;
}

.config__msg {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.85rem;
  min-height: 1.1em;
  color: var(--ok);
}
