:root {
  --bg: #0c0b0a;
  --bg-soft: #141210;
  --text: #f2efe9;
  --text-muted: #a39e94;
  --accent: #c9a87c;
  --accent-soft: rgba(201, 168, 124, 0.15);
  --border: rgba(242, 239, 233, 0.12);
  --radius: 12px;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100%; display: flex; flex-direction: column; }

.screen {
  display: none;
  flex: 1;
  padding: 2.5rem 1.5rem 4rem;
  animation: fadeIn 0.4s ease;
}
.screen.active { display: flex; align-items: center; justify-content: center; }

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

.container { width: 100%; max-width: 720px; margin: 0 auto; text-align: center; }
.container.narrow { max-width: 520px; }
.container.center { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }

.logo {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3.5rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 5.5vw, 3.2rem);
  line-height: 1.25;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 440px;
  margin: 0 auto 2.75rem;
  line-height: 1.7;
}

.beta-note {
  margin-top: 2.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
  letter-spacing: 0.04em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  background: transparent;
}
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn.primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn.ghost { border-color: var(--border); color: var(--text-muted); }
.btn.ghost:hover { border-color: var(--text-muted); color: var(--text); }
.btn.full { width: 100%; }
.btn-icon {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.2rem; cursor: pointer; padding: 0.4rem;
}
.btn-icon:hover { color: var(--text); }

.step-header { margin-bottom: 2.25rem; text-align: left; }
.step-num {
  display: block; font-size: 0.75rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 0.75rem;
}
.step-header h2 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: 1.85rem; margin-bottom: 0.6rem;
}
.step-header p { color: var(--text-muted); font-size: 0.95rem; }

.form-group { margin-bottom: 2rem; }
.form-group input {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.2rem; color: var(--text);
  font-family: var(--font-sans); font-size: 1rem; outline: none;
}
.form-group input:focus { border-color: var(--accent); }
.form-group input::placeholder { color: var(--text-muted); opacity: 0.6; }

.helper-text { font-size: 0.85rem; color: var(--text-muted); margin-top: 1rem; }

.nav-buttons {
  display: flex; justify-content: space-between; gap: 1rem;
}
.nav-buttons.column { flex-direction: column; }

/* Recorder */
.recorder { margin-bottom: 2rem; }
.record-btn {
  width: 100%; padding: 2rem 1.5rem; background: var(--bg-soft);
  border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--text-muted); cursor: pointer; display: flex;
  flex-direction: column; align-items: center; gap: 0.75rem;
  transition: all 0.2s; font-family: inherit; font-size: 0.95rem;
}
.record-btn:hover, .record-btn.recording {
  border-color: var(--accent); background: var(--accent-soft); color: var(--text);
}
.record-dot {
  width: 16px; height: 16px; border-radius: 50%; background: var(--accent);
  opacity: 0.6;
}
.record-btn.recording .record-dot {
  animation: blink 1s infinite; background: #e07a7a;
}
@keyframes blink { 50% { opacity: 0.2; } }

.record-preview { margin-top: 1.5rem; }
.record-preview.hidden { display: none; }
.record-preview audio { width: 100%; margin-bottom: 1rem; border-radius: 8px; }
.record-actions { display: flex; gap: 0.75rem; justify-content: center; }

/* Circle header */
.circle-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.75rem; text-align: left;
}
.circle-header h2 {
  font-family: var(--font-serif); font-weight: 400; font-size: 1.7rem;
}

/* Tabs */
.tabs {
  display: flex; gap: 0; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.tab {
  flex: 1; padding: 0.85rem; background: none; border: none;
  color: var(--text-muted); font-family: inherit; font-size: 0.9rem;
  cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

.cards-list { margin-bottom: 1.5rem; text-align: left; }
.member-card, .message-card {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 0.6rem;
  display: flex; justify-content: space-between; align-items: center;
}
.member-card .name, .message-card .title { font-weight: 500; font-size: 0.95rem; }
.member-card .status, .message-card .meta { font-size: 0.8rem; color: var(--text-muted); }
.empty-state {
  text-align: center; padding: 2rem 1rem; color: var(--text-muted); font-size: 0.9rem;
}

/* Invite */
.invite-box {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 2rem;
}
.invite-box input {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.85rem 1rem; color: var(--text);
  font-size: 0.85rem; margin-bottom: 1rem; outline: none;
}

/* Intentions / voice select */
.intentions-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
  margin-bottom: 2.5rem; text-align: left;
}
.intention-card {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem 1.1rem;
  cursor: pointer; text-align: left; transition: all 0.2s;
  color: inherit; font-family: inherit;
}
.intention-card:hover { border-color: rgba(201, 168, 124, 0.4); }
.intention-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.intention-title { display: block; font-size: 0.95rem; font-weight: 500; }

/* Textarea */
.textarea-wrap { position: relative; margin-bottom: 2.5rem; }
textarea {
  width: 100%; min-height: 160px; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.15rem 1.2rem; color: var(--text); font-family: var(--font-sans);
  font-size: 1rem; line-height: 1.6; resize: vertical; outline: none;
}
textarea:focus { border-color: var(--accent); }
textarea::placeholder { color: var(--text-muted); opacity: 0.6; }
.char-count {
  position: absolute; bottom: 0.75rem; right: 1rem;
  font-size: 0.75rem; color: var(--text-muted);
}

/* Summary */
.summary-box {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.4rem;
  margin-bottom: 2.5rem; text-align: left;
}
.summary-row { display: flex; gap: 1rem; padding: 0.5rem 0; }
.summary-row + .summary-row { border-top: 1px solid var(--border); }
.summary-row .label { flex: 0 0 90px; color: var(--text-muted); font-size: 0.85rem; }

/* Loader */
.loader { width: 64px; height: 64px; margin-bottom: 1.5rem; position: relative; }
.pulse {
  width: 100%; height: 100%; border-radius: 50%; background: var(--accent);
  opacity: 0.25; animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(0.75); opacity: 0.2; }
  50% { transform: scale(1); opacity: 0.45; }
}
.generating-title { font-family: var(--font-serif); font-weight: 400; font-size: 1.6rem; }
.generating-sub { color: var(--text-muted); font-size: 0.95rem; }

/* Result */
.result-title { font-family: var(--font-serif); font-weight: 400; font-size: 1.9rem; }
.result-sub { color: var(--text-muted); margin-bottom: 0.5rem; }
.audio-player-wrap { width: 100%; margin: 1.5rem 0; }
.audio-player-wrap audio { width: 100%; border-radius: 8px; outline: none; }
.result-actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.disclaimer {
  margin-top: 2.5rem; font-size: 0.75rem; color: var(--text-muted);
  opacity: 0.7; line-height: 1.5;
}
.error-text { color: #e07a7a; margin: 1rem 0 1.75rem; font-size: 0.95rem; }

@media (max-width: 540px) {
  .intentions-grid { grid-template-columns: 1fr; }
  .nav-buttons { flex-direction: column-reverse; }
  .nav-buttons .btn { width: 100%; }
}

/* === Additions Phase 1 viral + AI label === */
.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.ai-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  opacity: 0.85;
  margin-top: 0.5rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-block;
}

.consent-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.5rem;
  text-align: left;
  line-height: 1.55;
}

.cta-box {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--accent-soft);
  border: 1px solid rgba(201, 168, 124, 0.3);
  border-radius: var(--radius);
  width: 100%;
}
.cta-box p {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.legacy-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1.5rem;
  text-align: left;
  line-height: 1.55;
}
.legacy-note strong {
  color: var(--accent);
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
}

/* Language switcher */
#lang-switch {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  gap: 0.25rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem;
}
.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active {
  background: var(--text);
  color: var(--bg);
}

/* —— Cookie consent banner —— */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #14110d;
  border-top: 1px solid #4a3f33;
  padding: 1rem 1.25rem;
  display: none;
  font-family: var(--font-sans, Inter, system-ui, sans-serif);
}
#cookie-banner.visible { display: block; }
#cookie-banner .cookie-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
#cookie-banner p {
  flex: 1 1 280px;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #c7bda9;
}
#cookie-banner a { color: #c9a961; }
#cookie-banner .cookie-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
#cookie-banner button {
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid #4a3f33;
  background: transparent;
  color: #c7bda9;
}
#cookie-banner button.accept {
  background: #f4ebdc;
  color: #0a0907;
  border-color: #f4ebdc;
}
#cookie-banner button:hover { opacity: 0.9; }

.legal-link {
  display: block;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-muted, #85796a);
  text-decoration: none;
  opacity: 0.75;
}
.legal-link:hover { opacity: 1; color: var(--accent, #c9a961); }
