/* ===========================================
   REFERRAL PAGE — The Advocacy Desk
   "Every referral is a story."
   =========================================== */

.referral-page {
  background-color: var(--color-cream, #FDFBF7);
}

/* ===========================================
   HERO: The Advocacy Desk
   =========================================== */
.referral-hero {
  position: relative;
  height: 55vh;
  min-height: 380px;
  overflow: hidden;
}

.referral-hero-image {
  position: absolute;
  inset: 0;
  background-image: url('assets/referral-hero.jpg');
  background-size: cover;
  background-position: center;
  background-color: #d5cfc4; /* fallback */
}

.referral-hero-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  text-align: center;
  padding: 3rem 2rem 4rem;
  background: linear-gradient(
    to bottom,
    rgba(253, 251, 247, 0) 0%,
    rgba(253, 251, 247, 0.6) 60%,
    rgba(253, 251, 247, 0.95) 100%
  );
}

.referral-hero-headline {
  font-family: var(--font-serif, 'Lora', Georgia, serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--color-chocolate, #3A322C);
  font-weight: 500;
  line-height: 1.3;
  max-width: 700px;
  margin-bottom: 0.75rem;
}

.referral-hero-subheadline {
  font-size: 1.05rem;
  color: var(--color-slate, #4A433D);
  max-width: 560px;
  line-height: 1.6;
}

/* ===========================================
   JOURNEY MAP
   =========================================== */
.referral-journey {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

.journey-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.journey-card {
  background: white;
  border-radius: 1.25rem;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 2px 16px rgba(58, 50, 44, 0.04);
  transition: transform 0.25s, box-shadow 0.25s;
}

.journey-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(58, 50, 44, 0.1);
}

.journey-icon {
  color: var(--color-olive, #7A8B5E);
  margin-bottom: 1rem;
  display: inline-block;
}

.journey-card h3 {
  font-family: var(--font-serif, 'Lora', Georgia, serif);
  font-size: 1.1rem;
  color: var(--color-chocolate, #3A322C);
  margin-bottom: 0.5rem;
}

.journey-card p {
  font-size: 0.9rem;
  color: var(--color-slate, #4A433D);
  line-height: 1.6;
}

/* ===========================================
   REFERRAL WORKSPACE
   =========================================== */
.referral-workspace-section {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.workspace-card {
  background: var(--color-taupe, #F3EDE4);
  border-radius: 1.5rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 4px 28px rgba(58, 50, 44, 0.08);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.workspace-card.fading {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

/* Concierge Prompt */
.concierge-prompt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.concierge-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-olive, #7A8B5E);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.concierge-prompt p {
  font-family: var(--font-serif, 'Lora', Georgia, serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--color-chocolate, #3A322C);
}

/* Input Area */
.workspace-input-area {
  margin-bottom: 1rem;
}

.referral-input {
  width: 100%;
  min-height: 140px;
  padding: 1.25rem;
  border: 1.5px solid rgba(58, 50, 44, 0.1);
  border-radius: 1rem;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-chocolate, #3A322C);
  background: white;
  resize: vertical;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.referral-input:focus {
  outline: none;
  border-color: var(--color-olive, #7A8B5E);
  box-shadow: 0 0 0 3px rgba(122, 139, 94, 0.1);
}

.referral-input::placeholder {
  color: #b8b0a6;
  font-style: italic;
  font-size: 0.95rem;
}

/* Input Tools Row */
.input-tools {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: white;
  border: 1px solid rgba(58, 50, 44, 0.1);
  border-radius: 2rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  font-size: 0.85rem;
  color: var(--color-slate, #4A433D);
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.tool-button:hover {
  background: var(--color-olive, #7A8B5E);
  color: white;
  border-color: var(--color-olive, #7A8B5E);
}

/* Voice Active Indicator */
.voice-active-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 1.25rem;
  margin-top: 0.75rem;
  background: white;
  border-radius: 1rem;
  flex-direction: column;
}

.voice-wave-bar {
  width: 3px;
  height: 20px;
  background: var(--color-olive, #7A8B5E);
  border-radius: 2px;
  animation: voiceWave 0.8s ease-in-out infinite;
}

.voice-wave-bar:nth-child(2) { animation-delay: 0.1s; height: 28px; }
.voice-wave-bar:nth-child(3) { animation-delay: 0.2s; height: 36px; }
.voice-wave-bar:nth-child(4) { animation-delay: 0.3s; height: 28px; }
.voice-wave-bar:nth-child(5) { animation-delay: 0.4s; height: 20px; }

@keyframes voiceWave {
  0%, 100% { transform: scaleY(1); opacity: 0.5; }
  50% { transform: scaleY(1.6); opacity: 1; }
}

.voice-active-indicator p {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-olive, #7A8B5E);
  font-style: italic;
}

/* Context Preview Box */
.context-preview-box {
  background: white;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-left: 3px solid var(--color-olive, #7A8B5E);
}

.context-preview-label {
  font-size: 0.78rem;
  color: var(--color-slate, #4A433D);
  margin-bottom: 0.5rem;
  font-style: italic;
}

.context-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.context-tag {
  background: var(--color-olive, #7A8B5E);
  color: white;
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 2rem;
  font-weight: 500;
}

/* Submit Area */
.workspace-submit-area {
  text-align: center;
}

.submit-referral-btn {
  font-size: 1.05rem;
  padding: 0.9rem 2.5rem;
}

.submit-referral-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.submit-note {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--color-slate, #4A433D);
  font-style: italic;
}

/* ===========================================
   CONFIRMATION CARD
   =========================================== */
.confirmation-card {
  background: white;
  border-radius: 1.5rem;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: 0 4px 28px rgba(58, 50, 44, 0.08);
  animation: confirmFadeIn 0.5s ease;
}

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

.confirmation-icon {
  margin-bottom: 1.5rem;
}

.confirmation-card h2 {
  font-family: var(--font-serif, 'Lora', Georgia, serif);
  font-size: 1.5rem;
  color: var(--color-chocolate, #3A322C);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.confirmation-card p {
  font-size: 1rem;
  color: var(--color-slate, #4A433D);
  max-width: 480px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.confirmation-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 600px) {
  .referral-hero {
    height: 45vh;
    min-height: 300px;
  }

  .referral-hero-overlay {
    padding: 2rem 1.25rem 3rem;
  }

  .workspace-card {
    padding: 1.75rem 1.25rem;
  }

  .journey-grid {
    grid-template-columns: 1fr;
  }

  .confirmation-actions {
    flex-direction: column;
    align-items: center;
  }

  .confirmation-actions .btn,
  .confirmation-actions a {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .voice-wave-bar {
    animation: none;
  }
}
