/* ── App styles (voice-training flow) ── */
/* Extends theme.css. Uses the same design tokens (--bg, --accent, etc.) */

/* ── Utility ── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-muted { color: var(--text-muted); }

/* ── Spinner ── */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(245, 240, 232, 0.3);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle; margin-left: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Training Page ── */
.train-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 6rem 2rem 4rem;
}
.train-container {
  max-width: 600px; width: 100%;
}

/* Progress bar */
.train-progress { margin-bottom: 2.5rem; }
.progress-bar {
  width: 100%; height: 3px;
  background: var(--border); border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 16.66%;
}
.progress-label {
  font-size: 0.75rem; color: var(--text-subtle);
  margin-top: 0.5rem; letter-spacing: 0.05em;
}

/* Header */
.train-header { margin-bottom: 2rem; }
.train-header h1 { margin-bottom: 0.75rem; }
.train-subtitle { color: var(--text-muted); font-size: 1rem; line-height: 1.6; }

/* Steps */
.train-step { display: none; }
.train-step.active { display: block; }

/* Inputs */
.train-input, .train-textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  padding: 1rem 1.25rem;
  line-height: 1.6;
  transition: border-color 0.2s;
  resize: vertical;
}
.train-input:focus, .train-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.train-input.error, .train-textarea.error {
  border-color: #EF4444;
}
.train-input::placeholder, .train-textarea::placeholder {
  color: var(--text-subtle); font-size: 0.95rem;
}

/* Buttons */
.train-nav {
  display: flex; gap: 1rem; margin-top: 2rem;
}
.train-btn {
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: all 0.2s;
  display: inline-flex; align-items: center; justify-content: center;
}
.train-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.train-btn-primary {
  background: var(--accent); color: var(--bg);
}
.train-btn-primary:hover:not(:disabled) { background: #F59E0B; }
.train-btn-secondary {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
}
.train-btn-secondary:hover:not(:disabled) {
  border-color: var(--text-subtle); color: var(--text);
}

/* ── Results Page ── */
.results-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 6rem 2rem 4rem;
}
.results-container {
  max-width: 640px; width: 100%;
}

/* Loading state */
.results-loading {
  text-align: center; padding: 4rem 0;
}
.results-loading h2 { margin-top: 2rem; margin-bottom: 0.75rem; }
.fireplace-mini {
  width: 80px; height: 60px;
  background: #0D0B09;
  border-radius: 40px 40px 8px 8px;
  position: relative; overflow: hidden;
  margin: 0 auto;
  box-shadow: 0 0 40px rgba(217, 119, 6, 0.25);
}

/* Results header */
.results-header { margin-bottom: 2rem; }
.results-header h1 { margin-bottom: 0.75rem; }

/* Message preview card */
.message-preview {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.message-meta {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.message-avatar {
  width: 36px; height: 36px;
  background: var(--accent-dim);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.message-sender {
  font-weight: 600; color: var(--text); font-size: 0.9rem;
  display: block;
}
.message-context {
  font-size: 0.8rem; color: var(--text-subtle);
}
.message-body {
  color: var(--text-muted); font-size: 1rem; line-height: 1.75;
  white-space: pre-wrap;
}

/* Actions */
.results-actions {
  display: flex; gap: 1rem; margin-bottom: 2rem;
}

/* Approved banner */
.approved-banner {
  display: flex; align-items: flex-start; gap: 1rem;
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
}
.approved-icon { flex-shrink: 0; margin-top: 2px; }
.approved-banner h3 { color: var(--accent); margin-bottom: 0.25rem; font-family: 'DM Sans', sans-serif; }
.approved-banner p { font-size: 0.9rem; color: var(--text-muted); }

/* ── Demo Section (post-approval) ── */
.demo-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.demo-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  margin-bottom: 0.5rem;
}
.demo-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-family: 'DM Sans', sans-serif;
}
.demo-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

/* Client message preview */
.client-preview {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.75rem;
}
.client-preview-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.client-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #2D5A27;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: #C8F0C8;
  flex-shrink: 0;
}
.client-info-text {
  flex: 1;
}
.client-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  display: block;
}
.client-context {
  font-size: 0.8rem;
  color: var(--text-subtle);
}
.client-message-body {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

/* Demo CTA — "Send to yourself" */
.demo-email-form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  align-items: center;
}
.demo-email-input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
}
.demo-email-input:focus {
  outline: none;
  border-color: var(--accent);
}
.demo-send-btn {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.demo-send-btn:hover:not(:disabled) { background: #F59E0B; }
.demo-send-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.demo-sent-message {
  font-size: 0.85rem;
  color: #16A34A;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Divider */
.demo-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
  color: var(--text-subtle);
  font-size: 0.8rem;
}
.demo-divider::before,
.demo-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* CTA block */
.demo-cta-block {
  background: rgba(217, 119, 6, 0.06);
  border: 1px solid rgba(217, 119, 6, 0.15);
  border-radius: 14px;
  padding: 1.75rem;
  text-align: center;
}
.demo-cta-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-family: 'DM Sans', sans-serif;
}
.demo-cta-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}
.demo-cta-email-form {
  display: flex;
  gap: 0.5rem;
  max-width: 360px;
  margin: 0 auto;
}
.demo-cta-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 0.7rem 1rem;
}
.demo-cta-input:focus {
  outline: none;
  border-color: var(--accent);
}
.demo-cta-btn {
  padding: 0.7rem 1.25rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.demo-cta-btn:hover:not(:disabled) { background: #F59E0B; }
.demo-cta-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.demo-cta-success {
  font-size: 0.9rem;
  color: #16A34A;
  font-weight: 500;
  margin-top: 0.75rem;
}

/* ── Shareable Demo Link ── */
.share-link-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.share-link-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-subtle);
  margin-bottom: 0.35rem;
}
.share-link-heading {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
  font-family: 'DM Sans', sans-serif;
}
.share-link-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}
.share-link-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
.share-link-url-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  overflow: hidden;
}
.share-link-icon {
  flex-shrink: 0;
  color: var(--text-subtle);
}
.share-link-url {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: 'DM Mono', 'Courier New', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.share-copy-btn {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
}
.share-copy-btn:hover:not(:disabled) { background: #F59E0B; }
.share-copy-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.share-copy-success {
  font-size: 0.8rem;
  color: #16A34A;
  font-weight: 500;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .train-page, .results-page { padding: 5rem 1.25rem 3rem; }
  .train-nav { flex-direction: column; }
  .results-actions { flex-direction: column; }
  .train-btn { width: 100%; }
  .demo-email-form { flex-direction: column; }
  .demo-send-btn { width: 100%; }
  .demo-cta-email-form { flex-direction: column; }
  .demo-cta-btn { width: 100%; }
}
