/* Divorce Stoppers AI — Web Text Coach
   Brand-matched: black + red, Oswald + Inter, premium dark.
   Tailwind handles layout/utility; this file owns the custom bits. */

:root {
  --brand-red: #e53e3e;
  --brand-red-hover: #c53030;
  --brand-red-soft: rgba(229, 62, 62, 0.12);
  --brand-red-line: rgba(229, 62, 62, 0.30);
  --brand-dark: #0a0f18;
  --brand-ink: #05080c;
  --brand-crimson: #6b1520;
  --line-faint: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.10);
  --text-mute: #9ca3af;
  --text-faint: #6b7280;
  --bubble-recv: #1f2937;
  --green-soft: rgba(34, 197, 94, 0.10);
  --green-line: rgba(34, 197, 94, 0.40);
}

html { overflow-x: hidden; }
body { background-color: var(--brand-ink); color: #e2e8f0; min-height: 100vh; }

/* iOS globals — keep input font-size at 16px to prevent zoom-on-focus */
input, select, textarea { font-size: 16px !important; -webkit-tap-highlight-color: transparent; }
* { -webkit-tap-highlight-color: transparent; }

/* ---------- 3-step indicator ---------- */
.step-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  opacity: 0.45;
  transition: opacity 0.25s;
}
.step-pill.active { opacity: 1; }
.step-pill .step-num {
  width: 2.25rem; height: 2.25rem;
  border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-weight: 900; font-size: 0.95rem;
  background: #18202e;
  color: #4b5563;
  border: 1px solid var(--line);
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}
.step-pill.active .step-num {
  background: var(--brand-red);
  color: #fff;
  border-color: var(--brand-red);
  box-shadow: 0 0 18px rgba(229, 62, 62, 0.32);
}
.step-pill.done .step-num {
  background: #1a2a44;
  color: var(--brand-red);
  border-color: var(--brand-red-line);
}
.step-pill .step-label {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6b7280;
}
.step-pill.active .step-label { color: #e5e7eb; }

.step-connector {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, var(--line) 0%, var(--brand-red-line) 50%, var(--line) 100%);
  margin-bottom: 1.4rem;
}
@media (min-width: 480px) { .step-connector { width: 3rem; } }

/* ---------- Card / state panels ---------- */
.card {
  background: linear-gradient(180deg, #0e1422 0%, #0a0f18 100%);
  border: 1px solid var(--line);
  padding: 1.75rem 1.5rem;
  border-radius: 0.5rem;
  position: relative;
  box-shadow: 0 18px 42px -18px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  animation: fadeUp 0.35s ease forwards;
}
@media (min-width: 640px) {
  .card { padding: 2.25rem 2rem; }
}
.card.crisis { border-color: var(--brand-red); background: linear-gradient(180deg, #2a0a0e 0%, #14070a 100%); }
.card.hidden { display: none; }

.card-step-tag {
  position: absolute;
  top: -0.6rem;
  left: 1.25rem;
  background: var(--brand-ink);
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--brand-red-line);
  border-radius: 0.15rem;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Branded input (modal forms) ---------- */
.branded-input {
  width: 100%;
  background: #0d1320;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.75rem 0.9rem;
  color: #e5e7eb;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.branded-input::placeholder { color: #4b5563; }
.branded-input:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px var(--brand-red-soft);
}

/* ---------- Branded textarea ---------- */
.branded-textarea {
  width: 100%;
  background: #0d1320;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 1rem 1.1rem;
  color: #e5e7eb;
  font-family: 'Inter', sans-serif;
  line-height: 1.55;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.branded-textarea::placeholder { color: #4b5563; }
.branded-textarea:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px var(--brand-red-soft);
}

/* ---------- Buttons ---------- */
.btn-brand-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-red);
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
  text-decoration: none;
}
.btn-brand-primary:hover {
  background: var(--brand-red-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -10px rgba(229, 62, 62, 0.45);
}
.btn-brand-primary:disabled {
  background: #4b5563;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-brand-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #e5e7eb;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 1rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.btn-brand-secondary:hover {
  border-color: var(--brand-red);
  color: #fff;
  background: rgba(229, 62, 62, 0.06);
}

.btn-brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-mute);
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 0.85rem 1rem;
  border: none;
  cursor: pointer;
  transition: color 0.18s;
}
.btn-brand-link:hover { color: var(--brand-red); }

.btn-copy {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  color: #9ca3af;
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border-radius: 0.2rem;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
}
.btn-copy:hover { border-color: var(--brand-red); color: #fff; }

/* ---------- Phone bubbles ---------- */
.bubble-received {
  background: var(--bubble-recv);
  color: #e5e7eb;
  padding: 0.85rem 1.1rem;
  border-radius: 1.2rem 1.2rem 1.2rem 0.3rem;
  max-width: 95%;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

/* "Send her this" bubble — the hero output */
.bubble-send {
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: #d1fae5;
  padding: 1.1rem 1.25rem;
  border-radius: 1.2rem 1.2rem 0.3rem 1.2rem;
  font-size: 1.15rem;
  line-height: 1.5;
  font-weight: 500;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- Analysis rows ---------- */
.analysis-row {
  background: linear-gradient(90deg, var(--brand-red-soft) 0%, transparent 100%);
  border-left: 3px solid var(--brand-red);
  padding: 0.85rem 1rem;
  border-radius: 0 0.25rem 0.25rem 0;
}
.analysis-row h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fca5a5;
  margin-bottom: 0.35rem;
}
.analysis-row p {
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ---------- Critique blocks ---------- */
.critique-block h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
}

.ul-good, .ul-bad, .ul-changes {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ul-good li,
.ul-bad li,
.ul-changes li {
  position: relative;
  padding: 0.6rem 0.85rem 0.6rem 2.1rem;
  background: #0d1320;
  border: 1px solid var(--line-faint);
  border-radius: 0.3rem;
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.55;
}
.ul-good li::before,
.ul-bad li::before,
.ul-changes li::before {
  position: absolute;
  left: 0.75rem;
  top: 0.62rem;
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.72rem;
}
.ul-good li::before { content: '\f00c'; color: #4ade80; }
.ul-bad li::before { content: '\f071'; color: var(--brand-red); }
.ul-changes li::before { content: '\f111'; color: var(--brand-red); font-weight: 900; font-size: 0.45rem; top: 0.85rem; }

/* ---------- Principle pills ---------- */
.principle-pills {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.principle-pills li {
  display: inline-flex;
  align-items: center;
  background: var(--brand-red-soft);
  border: 1px solid var(--brand-red-line);
  color: #fca5a5;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
}

/* Voice note (Denver tone footer on critique) */
.voice-note {
  font-family: 'Oswald', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9ca3af;
  font-style: italic;
  margin-top: 0.5rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--brand-crimson);
}

/* ---------- CTA block ---------- */
.cta-block {
  background: linear-gradient(135deg, rgba(107, 21, 32, 0.55) 0%, rgba(10, 15, 24, 0.7) 100%);
  border: 1px solid var(--brand-red-line);
  border-radius: 0.4rem;
  padding: 1.5rem;
  text-align: center;
}
.cta-line {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: #e5e7eb;
  margin-bottom: 1.1rem;
}
@media (min-width: 640px) {
  .cta-line { font-size: 1.05rem; }
}
.cta-button {
  font-size: 1.05rem !important;
  padding: 1.1rem 2rem !important;
}
.cta-fineprint {
  font-size: 0.7rem;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-top: 0.85rem;
}

/* ---------- Trust strip ---------- */
.trust-stat {
  background: #0d1320;
  border: 1px solid var(--line-faint);
  border-radius: 0.3rem;
  padding: 0.85rem 0.5rem;
}
.trust-num {
  font-family: 'Oswald', sans-serif;
  font-weight: 900;
  font-size: 1.55rem;
  color: var(--brand-red);
  line-height: 1.05;
}
.trust-label {
  font-family: 'Oswald', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-top: 0.25rem;
}

/* ---------- Loading overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}
.overlay.hidden { display: none; }
.overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  padding: 2rem 2.5rem;
  background: #0e1422;
  border: 1px solid var(--brand-red-line);
  border-radius: 0.4rem;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
}
.spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(229, 62, 62, 0.18);
  border-top-color: var(--brand-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Error banner ---------- */
.error-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  background: #2a0a0e;
  border: 1px solid var(--brand-red);
  color: #fecaca;
  padding: 0.85rem 1.2rem;
  border-radius: 0.3rem;
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 200;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.55);
}
.error-banner.hidden { display: none; }

/* ---------- Avatars ---------- */
.hdr-avatar {
  width: 2rem; height: 2rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 1.5px solid var(--brand-red);
  box-shadow: 0 0 12px rgba(229, 62, 62, 0.25);
}
@media (min-width: 768px) {
  .hdr-avatar { width: 2.4rem; height: 2.4rem; }
}
.denver-avatar {
  width: 3.25rem; height: 3.25rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid var(--brand-red);
  box-shadow: 0 6px 18px -6px rgba(229, 62, 62, 0.4);
  flex-shrink: 0;
}
.denver-avatar-sm {
  width: 1.6rem; height: 1.6rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 1.5px solid var(--brand-red);
  flex-shrink: 0;
}
.denver-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.denver-bubble-row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.denver-name {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-red);
  margin-bottom: 0.35rem;
}
.denver-bubble {
  background: #1f2937;
  color: #e5e7eb;
  padding: 0.85rem 1.1rem;
  border-radius: 1rem 1rem 1rem 0.3rem;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ---------- Onboarding ---------- */
.onboard-form {
  margin-top: 0.5rem;
}
.onboard-row {
  margin-bottom: 1.4rem;
}
.onboard-q {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: #e5e7eb;
  margin-bottom: 0.6rem;
}
.onboard-help {
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 0.4rem;
  font-style: italic;
}
.onboard-input {
  min-height: auto;
}
textarea.onboard-input {
  min-height: 60px;
}

/* Choice chips */
.choice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.choice-chip {
  display: inline-flex;
  align-items: center;
  background: #0d1320;
  border: 1px solid var(--line);
  color: #cbd5e1;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.55rem 0.95rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.choice-chip:hover {
  border-color: var(--brand-red-line);
  color: #fff;
}
.choice-chip.selected {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
  box-shadow: 0 0 14px -2px rgba(229, 62, 62, 0.35);
}

/* ---------- User's own message bubble (right-aligned, his read) ---------- */
.bubble-self {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.18);
  color: #dbeafe;
  padding: 0.85rem 1.1rem;
  border-radius: 1.2rem 1.2rem 0.3rem 1.2rem;
  max-width: 95%;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  margin-left: auto;
}

.bubble-compact {
  font-size: 0.85rem;
  padding: 0.65rem 0.9rem;
  line-height: 1.45;
}

/* ---------- Audio delivery (Step 5 — anti-extraction) ---------- */
.audio-block {
  background: rgba(15, 22, 35, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.85rem;
  padding: 1.4rem 1.2rem 1.2rem;
  margin: 1rem 0 1.2rem;
}

.coach-audio {
  width: 100%;
  margin: 0;
  outline: none;
  filter: invert(0.85) hue-rotate(180deg);  /* dark-mode native control */
}

.audio-help {
  margin-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--text-muted, #9ca3af);
  font-style: italic;
}

/* Discourage casual transcript fishing — block selection on the audio block.
   Not a security boundary; the bytes are token-gated server-side. */
.audio-block, .audio-block * {
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- Draft reference (shown above coaching) ---------- */
.draft-ref-section {
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.04);
  margin-bottom: 1.5rem;
}

.draft-ref-body {
  padding: 0.8rem 1.1rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: #93c5fd;
  font-style: italic;
}

/* ---------- Transcript (always visible, below audio) ---------- */
.transcript-section {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.transcript-label {
  font-family: var(--font-heading, 'Oswald', sans-serif);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted, #9ca3af);
  margin: 0;
  padding: 0.8rem 1rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.transcript-body {
  padding: 1rem 1.1rem;
  font-size: 0.92rem;
  line-height: 1.75;
  color: #d1d5db;
}

.transcript-body p {
  margin: 0 0 0.85rem 0;
}
.transcript-body p:last-child {
  margin-bottom: 0;
}

/* ---------- Auth modals ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 12, 0.88);
  backdrop-filter: blur(6px);
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 28rem;
  background: linear-gradient(180deg, #0e1422 0%, #0a0f18 100%);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 2rem 1.75rem;
  box-shadow: 0 18px 42px -18px rgba(0, 0, 0, 0.55);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.modal-close:hover { color: #fff; }

/* Tailwind build gaps — classes used in index.html but missing from tailwind.css */
.justify-center { justify-content: center; }
.max-w-lg { max-width: 32rem; }

/* ---------- Utility ---------- */
.hidden { display: none; }
