/*
 * Legacy Brand CSS — ardon design system
 *
 * Palette: warm ivory backgrounds, soft stone panels, charcoal text, amber accents
 * Typography: serif headings, sans-serif body
 * Tone: gentle, reassuring, optional
 */

/* ─── Design Tokens ──────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --legacy-bg: #FAF7F2;               /* warm ivory */
  --legacy-bg-alt: #F3EDE4;           /* soft parchment */
  --legacy-panel: #EDE8DF;            /* soft stone */
  --legacy-panel-hover: #E5DFD4;      /* stone hover */

  /* Text */
  --legacy-text: #2C2C2C;             /* charcoal */
  --legacy-text-secondary: #6B6560;   /* warm gray */
  --legacy-text-muted: #9B9590;       /* muted */

  /* Accents */
  --legacy-accent: #C8913A;           /* amber */
  --legacy-accent-hover: #B07E2F;     /* amber dark */
  --legacy-accent-light: #F0DDB8;     /* amber tint */
  --legacy-success: #6B8E5A;          /* sage green */
  --legacy-error: #C45C4A;            /* warm red */
  --legacy-info: #5B7FA6;             /* slate blue */

  /* Borders */
  --legacy-border: #DDD7CE;           /* warm border */
  --legacy-border-light: #EAE5DC;     /* subtle border */

  /* Typography */
  --legacy-font-heading: 'Georgia', 'Times New Roman', serif;
  --legacy-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing */
  --legacy-radius: 12px;
  --legacy-radius-sm: 8px;
  --legacy-radius-lg: 16px;

  /* Shadows */
  --legacy-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --legacy-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ─── Base ────────────────────────────────────────────────────────── */
body.legacy-brand {
  font-family: var(--legacy-font-body);
  background: var(--legacy-bg);
  color: var(--legacy-text);
  min-height: 100vh;
}

body.legacy-brand h1,
body.legacy-brand h2,
body.legacy-brand h3 {
  font-family: var(--legacy-font-heading);
  font-weight: 400;
  color: var(--legacy-text);
}

/* ─── Header ──────────────────────────────────────────────────────── */
body.legacy-brand .header {
  background: var(--legacy-panel);
  border-bottom: 1px solid var(--legacy-border);
  padding: 0.75rem 1.5rem;
}

body.legacy-brand .logo {
  font-family: var(--legacy-font-heading);
  color: var(--legacy-accent);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* ─── Cards / Panels ──────────────────────────────────────────────── */
body.legacy-brand .interview-card,
body.legacy-brand .legacy-card {
  background: white;
  border: 1px solid var(--legacy-border-light);
  border-radius: var(--legacy-radius);
  box-shadow: var(--legacy-shadow);
  padding: 1.5rem;
}

body.legacy-brand .phase-title {
  font-family: var(--legacy-font-heading);
  color: var(--legacy-accent);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
  font-weight: 400;
}

body.legacy-brand .prompt {
  font-family: var(--legacy-font-body);
  color: var(--legacy-text);
  font-size: 1.15rem;
  line-height: 1.6;
}

/* ─── Buttons ─────────────────────────────────────────────────────── */
body.legacy-brand .btn-primary,
body.legacy-brand .record-btn {
  background: var(--legacy-accent);
  border: none;
  color: white;
  border-radius: var(--legacy-radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

body.legacy-brand .btn-primary:hover,
body.legacy-brand .record-btn:hover {
  background: var(--legacy-accent-hover);
  transform: scale(1.02);
}

body.legacy-brand .record-btn {
  border-radius: 50%;
}

body.legacy-brand .record-btn.recording {
  background: var(--legacy-error);
  animation: legacy-pulse 1.5s ease-in-out infinite;
}

@keyframes legacy-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 92, 74, 0.3); }
  50% { box-shadow: 0 0 0 16px rgba(196, 92, 74, 0); }
}

body.legacy-brand .btn-secondary {
  background: transparent;
  border: 1px solid var(--legacy-border);
  color: var(--legacy-text-secondary);
  border-radius: var(--legacy-radius-sm);
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

body.legacy-brand .btn-secondary:hover {
  border-color: var(--legacy-accent);
  color: var(--legacy-accent);
}

/* ─── Progress ────────────────────────────────────────────────────── */
body.legacy-brand .progress-bar {
  background: var(--legacy-border-light);
}

body.legacy-brand .progress-fill {
  background: linear-gradient(90deg, var(--legacy-accent-light), var(--legacy-accent));
}

body.legacy-brand .phase-dot {
  background: var(--legacy-border);
}

body.legacy-brand .phase-dot.active {
  background: var(--legacy-accent);
}

body.legacy-brand .phase-dot.completed {
  background: var(--legacy-success);
}

body.legacy-brand #phase-label {
  color: var(--legacy-text-secondary);
}

/* ─── Emotional Tags ──────────────────────────────────────────────── */
body.legacy-brand .emotional-tag {
  background: var(--legacy-accent-light);
  color: var(--legacy-accent-hover);
}

/* ─── Voice Mode ──────────────────────────────────────────────────── */
body.legacy-brand .voice-phase-dot {
  background: var(--legacy-border);
}

body.legacy-brand .voice-phase-dot.active {
  background: var(--legacy-accent);
}

body.legacy-brand .voice-phase-dot.completed {
  background: var(--legacy-success);
}

/* ─── Form Elements ───────────────────────────────────────────────── */
body.legacy-brand select,
body.legacy-brand .voice-select {
  background: white;
  border: 1px solid var(--legacy-border);
  color: var(--legacy-text);
  border-radius: var(--legacy-radius-sm);
}

body.legacy-brand select:hover,
body.legacy-brand .voice-select:hover {
  border-color: var(--legacy-accent);
}

body.legacy-brand select option,
body.legacy-brand .voice-select option {
  background: white;
  color: var(--legacy-text);
}

/* ─── Chat / Conversation ─────────────────────────────────────────── */
body.legacy-brand .message.assistant .bubble {
  background: var(--legacy-panel);
  color: var(--legacy-text);
  border: 1px solid var(--legacy-border-light);
}

body.legacy-brand .message.user .bubble {
  background: var(--legacy-accent);
  color: white;
}

body.legacy-brand .persona-avatar {
  background: linear-gradient(135deg, var(--legacy-accent), var(--legacy-accent-hover));
}

body.legacy-brand .persona-status {
  color: var(--legacy-success);
}

/* ─── Status Messages ─────────────────────────────────────────────── */
body.legacy-brand .status-message.error {
  color: var(--legacy-error);
}

body.legacy-brand .status-message.success {
  color: var(--legacy-success);
}

/* ─── Toggle Switch ───────────────────────────────────────────────── */
body.legacy-brand .toggle-switch {
  background: var(--legacy-border);
}

body.legacy-brand .toggle-switch.active {
  background: var(--legacy-success);
}

body.legacy-brand .toggle-container {
  color: var(--legacy-text-secondary);
}

/* ─── Transparency Panel ──────────────────────────────────────────── */
body.legacy-brand .transparency-panel {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
}

body.legacy-brand .transparency-toggle {
  background: white;
  border: 1px solid var(--legacy-border);
  border-radius: var(--legacy-radius);
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  color: var(--legacy-text-secondary);
  cursor: pointer;
  box-shadow: var(--legacy-shadow);
  transition: all 0.2s;
}

body.legacy-brand .transparency-toggle:hover {
  border-color: var(--legacy-accent);
  color: var(--legacy-accent);
}

body.legacy-brand .transparency-content {
  display: none;
  background: white;
  border: 1px solid var(--legacy-border);
  border-radius: var(--legacy-radius);
  padding: 1.25rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--legacy-shadow-lg);
  max-width: 360px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--legacy-text-secondary);
}

body.legacy-brand .transparency-content.open {
  display: block;
}

body.legacy-brand .transparency-content h4 {
  font-family: var(--legacy-font-heading);
  color: var(--legacy-text);
  margin-bottom: 0.5rem;
  font-weight: 400;
}

/* ─── Microcopy Helpers ───────────────────────────────────────────── */
body.legacy-brand .gentle-hint {
  font-size: 0.8rem;
  color: var(--legacy-text-muted);
  font-style: italic;
}

body.legacy-brand .reassuring-note {
  font-size: 0.85rem;
  color: var(--legacy-text-secondary);
  padding: 0.75rem 1rem;
  background: var(--legacy-bg-alt);
  border-radius: var(--legacy-radius-sm);
  border-left: 3px solid var(--legacy-accent-light);
}

/* ─── Family Portal Entry ─────────────────────────────────────────── */
body.legacy-brand .family-welcome {
  text-align: center;
  padding: 3rem 1.5rem;
}

body.legacy-brand .family-welcome h2 {
  font-family: var(--legacy-font-heading);
  font-size: 1.6rem;
  color: var(--legacy-text);
  margin-bottom: 0.5rem;
}

body.legacy-brand .family-welcome p {
  color: var(--legacy-text-secondary);
  font-size: 1rem;
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

body.legacy-brand .leave-note {
  font-size: 0.75rem;
  color: var(--legacy-text-muted);
  margin-top: 2rem;
}

/* ─── Waveform Override ───────────────────────────────────────────── */
body.legacy-brand .waveform-container {
  background: var(--legacy-bg-alt);
  border-radius: var(--legacy-radius-sm);
}
