/* ── Glebia App Styles ──────────────────────────────────────────
   Matches the landing page design language:
   warm cream bg, terracotta accent, Playfair Display / DM Sans
   ──────────────────────────────────────────────────────────── */

:root {
  --bg: #FAF8F5;
  --bg-alt: #F2EDE7;
  --fg: #1C1B18;
  --fg-muted: #7A7570;
  --accent: #C9773A;
  --accent-deep: #9E5A28;
  --border: #E2DBD4;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Nav ──────────────────────────────────────────────────── */
.nav {
  padding: 28px 48px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.nav-wordmark {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg);
  text-decoration: none;
}

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; }
em { font-style: italic; font-weight: 400; }

/* ── Page layout ────────────────────────────────────────── */
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 24px;
}

.container {
  width: 100%;
  max-width: 560px;
}

/* ── Forms ──────────────────────────────────────────────── */
.form-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px;
  box-shadow: 0 2px 24px rgba(0,0,0,0.04);
}

.form-heading {
  font-size: 1.75rem;
  margin-bottom: 8px;
  color: var(--fg);
}
.form-subheading {
  color: var(--fg-muted);
  margin-bottom: 36px;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 24px;
}
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  transition: border-color 0.2s;
  appearance: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,119,58,0.12);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A7570' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

/* ── Stress level slider ────────────────────────────────── */
.slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, #C9773A 0%, #C9773A var(--pct, 50%), var(--border) var(--pct, 50%));
  border-radius: 2px;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: pointer;
}
.slider-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--fg-muted);
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
}
.btn-primary:hover { background: var(--accent-deep); }

/* ── Session player ─────────────────────────────────────── */
.player-layout {
  width: 100%;
  max-width: 640px;
}

.player-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
.meta-pill {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.meta-pill-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  margin-bottom: 4px;
}
.meta-pill-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.player-backdrop-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
}
.backdrop-btn {
  flex: 1;
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg-muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.backdrop-btn:hover { border-color: var(--accent); color: var(--fg); }
.backdrop-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.player-script {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  margin-bottom: 28px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.script-line {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.65;
  color: var(--fg);
  opacity: 0;
  animation: fade-in 0.8s ease forwards;
}
.script-line:nth-child(1) { animation-delay: 0.2s; }
.script-line:nth-child(2) { animation-delay: 2s; }
.script-line:nth-child(3) { animation-delay: 4s; }
.script-line:nth-child(4) { animation-delay: 6s; }
.script-line:nth-child(5) { animation-delay: 8s; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Audio controls ──────────────────────────────────────── */
.audio-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 20px;
}
.play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.play-btn:hover { background: var(--accent-deep); }
.play-icon { width: 0; height: 0; border-style: solid; border-width: 10px 0 10px 18px; border-color: transparent transparent transparent white; }
.pause-icon { width: 16px; height: 18px; display: flex; gap: 4px; }
.pause-icon span { width: 5px; height: 18px; background: white; border-radius: 2px; }

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.volume-icon { color: var(--fg-muted); flex-shrink: 0; }
.volume-slider {
  flex: 1;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s linear;
}

.player-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.player-hint {
  font-size: 0.8rem;
  color: var(--fg-muted);
}
.complete-btn {
  padding: 10px 20px;
  border-radius: 10px;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.complete-btn:hover { background: #000; }

/* ── Modality selector (card style) ─────────────────────── */
.modality-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.modality-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 12px;
  cursor: pointer;
  text-align: center;
  background: var(--bg);
  transition: all 0.2s;
  font-family: var(--font-body);
}
.modality-card:hover { border-color: var(--accent); }
.modality-card.selected {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.modality-card-name {
  font-size: 0.95rem;
  font-weight: 400;
  margin-bottom: 4px;
}
.modality-card-desc {
  font-size: 0.7rem;
  opacity: 0.7;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav { padding: 20px 24px; }
  .form-card { padding: 28px 20px; }
  .player-meta { grid-template-columns: 1fr; }
  .modality-grid { grid-template-columns: 1fr; }
  .player-backdrop-selector { flex-direction: column; }
}