/* 3 Questions Helper — styles
   Brand colors: navy #1B2A4A, sand beige #E9DCC3, light beige #F7F1E6.
   Phone-first: fills the phone screen; on a computer it sits in a centered card. */

:root {
  --navy: #1B2A4A;
  --navy-ink: #FFFFFF;
  --sand: #E9DCC3;
  --cream: #F7F1E6;
  --paper: #FFFFFF;
  --ink: #1A1F2B;
  --muted: #4A4F5C;
  --line: #9C9384;
  --line-soft: #DCCDB2;
  --warn-bg: #FFF6E0;
  --warn-line: #A85C00;
  --warn-ink: #6B3A00;
  --ok: #1E6B3A;
  --font: "Lexend", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

/* The app column: full width on a phone, a centered card on a computer */
.app {
  max-width: 440px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}
@media (min-width: 520px) {
  body { padding: 32px 16px; }
  .app {
    min-height: auto;
    border: 1px solid var(--line-soft);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(27, 42, 74, 0.12);
  }
}

.screen { display: flex; flex-direction: column; flex: 1; }
.screen[hidden] { display: none; }

/* Brand header on Question 1 */
.brandband {
  background: var(--sand);
  padding: calc(24px + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) 16px max(24px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 4px;
  border-bottom: 1px solid var(--line-soft);
}
.brand { font-size: 12px; font-weight: 800; letter-spacing: 1.2px; color: var(--navy); }
.tagline { font-size: 21px; font-weight: 700; color: var(--ink); text-wrap: balance; }
.private { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }

.body {
  padding: 20px max(24px, env(safe-area-inset-right, 0px)) 8px max(24px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 14px; flex: 1;
}
.body.top { padding-top: calc(28px + env(safe-area-inset-top, 0px)); }

.progress { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; color: var(--muted); }
.dots { display: flex; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--line-soft); }
.dot.on { background: var(--navy); }
.dot.now { width: 24px; background: var(--navy); }

.q { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--ink); text-wrap: balance; }

/* Text boxes with the microphone inside */
.field { position: relative; }
.field textarea {
  width: 100%;
  border: 2px solid var(--line); border-radius: 14px;
  padding: 14px 60px 14px 14px;
  font: 400 17px/1.4 var(--font); color: var(--ink); background: var(--paper);
  resize: vertical;
}
.field textarea::placeholder { color: #6B6F79; }
.field textarea:focus { outline: 3px solid var(--sand); border-color: var(--navy); }
.no-mic .field textarea { padding-right: 14px; }

.mic {
  position: absolute; right: 10px; bottom: 12px;
  width: 44px; height: 44px; border-radius: 22px;
  border: 2px solid var(--line); background: var(--paper); color: var(--ink);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.mic.listening { background: var(--navy); color: var(--navy-ink); border-color: var(--navy); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(27, 42, 74, 0.18); } }
.no-mic .mic { display: none; }

.status { margin: -6px 0 0; font-size: 14px; color: var(--navy); font-weight: 600; min-height: 0; }
.status:empty, .counter:empty { display: none; }
.counter { margin: -6px 0 0; font-size: 13px; color: var(--muted); text-align: right; }

.hint { font-size: 14px; font-weight: 600; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 14px; border-radius: 22px;
  border: 1px solid var(--line); background: var(--cream);
  font: 400 15px var(--font); color: var(--ink); cursor: pointer;
}
.chip:hover { border-color: var(--navy); }

.warn { border: 2px solid var(--warn-line); background: var(--warn-bg); border-radius: 12px; padding: 12px 14px; font-size: 15px; line-height: 1.4; color: var(--warn-ink); }
.warn.strong { border-width: 3px; }

.formats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fmt {
  min-height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper);
  font: 400 16px var(--font); color: var(--ink); cursor: pointer; padding: 4px 8px;
}
.fmt[aria-pressed="true"] { border: 3px solid var(--navy); background: var(--sand); font-weight: 700; }

/* Bottom buttons */
.foot {
  padding: 12px max(24px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
  display: flex; gap: 12px;
  position: sticky; bottom: 0; background: var(--paper);
}
.btn {
  min-height: 56px; border-radius: 14px; font: 700 18px var(--font); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.btn.primary { flex: 1; border: none; background: var(--navy); color: var(--navy-ink); }
.btn.primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.ghost { width: 110px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); font-weight: 600; }
.btn.big { min-height: 60px; font-size: 20px; font-weight: 800; width: 100%; flex: none; }
button:focus-visible, input:focus-visible, .promptbox:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

/* The prompt screen */
.promptbox {
  border: 1px solid var(--line-soft); border-radius: 12px; background: var(--cream);
  padding: 14px; font: 400 15px/1.5 var(--font); color: var(--ink);
  white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 300px; overflow-y: auto;
  -webkit-user-select: text; user-select: text;
}
.center { margin: 0; text-align: center; font-size: 15px; color: var(--muted); }
.links { display: flex; justify-content: center; gap: 24px; }
.linkbtn { background: none; border: none; padding: 10px 4px; min-height: 44px; font: 500 15px var(--font); color: var(--navy); text-decoration: underline; cursor: pointer; }
.copied { color: var(--ok); font-weight: 700; }

/* Email sign-up */
.signup {
  margin: 8px max(24px, env(safe-area-inset-right, 0px)) 16px max(24px, env(safe-area-inset-left, 0px));
  border-top: 1px dashed var(--line); padding-top: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.signup[hidden] { display: none; }
.signup h3 { margin: 0; font-size: 17px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.lbl { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); min-width: 0; }
.lbl-name { flex: 1 1 110px; }
.lbl-email { flex: 2 1 180px; }
.lbl input { height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: 400 16px var(--font); color: var(--ink); background: var(--paper); width: 100%; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--ink); }
.check input { width: 20px; height: 20px; margin: 0; flex: none; }
.signup-actions { display: flex; align-items: center; gap: 16px; }
.join { height: 44px; padding: 0 22px; border-radius: 10px; border: 2px solid var(--navy); background: var(--paper); color: var(--navy); font: 700 16px var(--font); cursor: pointer; }
.join:disabled { opacity: 0.4; cursor: not-allowed; }
.signup-msg { margin: 0; font-size: 14px; color: var(--warn-ink); }
.signup-msg:empty { display: none; }
.thanks { margin: 0; font-size: 15px; color: var(--ok); font-weight: 600; }

.footer {
  padding: 12px 24px calc(16px + env(safe-area-inset-bottom, 0px));
  font-size: 12px; color: var(--muted); text-align: center;
  border-top: 1px solid var(--line-soft); background: var(--cream);
}

@media (prefers-reduced-motion: reduce) { .mic.listening { animation: none; } }
