/* tonus.css — стили для итерации 2.
 *
 * Минималистичный дизайн в духе спокойных продуктов: тёплый бежевый фон,
 * приглушённые цвета, серифный заголовок, sans-serif для прозы. Без анимаций,
 * без градиентов, без иконок. Финальный визуальный язык будет в отдельной
 * итерации — здесь задача в том, чтобы интерфейс не отвлекал.
 */

:root {
  --bg: #f7f5f1;
  --bg-card: #ffffff;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --muted-light: #9a9690;
  --accent: #2a4a3a;
  --accent-hover: #1d3528;
  --accent-light: #e8eee8;
  --border: #d8d4cc;
  --border-light: #ebe8e1;
  --warning-bg: #fdf6e3;
  --warning-border: #d4c8a8;
  --error: #a13e3e;
  --success: #2a4a3a;

  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
}

h1 {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 400;
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  margin: 40px 0 12px 0;
}

h3 {
  font-family: var(--serif);
  font-weight: 400;
  margin-top: 24px;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

p { margin: 12px 0; }

ul { padding-left: 24px; }
ul li { margin: 8px 0; }

/* === Универсальные элементы === */

.page-header {
  margin-bottom: 32px;
}

.subtitle {
  color: var(--muted);
  font-size: 17px;
  margin-top: 8px;
}

.back-link {
  display: inline-block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
  text-decoration: none;
}
.back-link:hover { color: var(--accent); }

.cta {
  display: inline-block;
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-size: 16px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.cta:hover {
  background: var(--accent-hover);
  color: white;
}
.cta-disabled {
  background: var(--muted-light);
  border-color: var(--muted-light);
  cursor: not-allowed;
}
.cta-disabled:hover {
  background: var(--muted-light);
}

button.cta {
  font-family: inherit;
  font-size: 16px;
}

.cta-block {
  margin: 32px 0;
}

.text-link {
  background: none;
  border: none;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.text-danger { color: var(--error); }

.error-message {
  background: #fee;
  border: 1px solid #ebb;
  padding: 12px 16px;
  border-radius: 4px;
  color: var(--error);
}

.muted { color: var(--muted); }

/* === Лендинг === */

.landing .hero {
  margin-bottom: 16px;
}
.landing .tagline {
  font-size: 22px;
  color: var(--muted);
  margin: 0 0 32px 0;
}
.landing .prose {
  margin-bottom: 48px;
}
.landing .rule {
  background: var(--accent-light);
  padding: 24px;
  border-radius: 4px;
  border-left: 3px solid var(--accent);
}
.landing .rule h2 {
  margin-top: 0;
}
.landing .rule-statement {
  font-size: 18px;
}
.cta-final {
  text-align: center;
  margin: 64px 0 32px 0;
}
.footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* === Выбор практики === */

.practice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 24px;
}

.practice-card {
  display: block;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.15s, transform 0.15s;
}
.practice-card:hover {
  border-color: var(--accent);
  color: var(--fg);
}

.practice-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.practice-card h2 {
  font-size: 24px;
  margin: 0;
}

.range-badge {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  padding: 4px 8px;
  border-radius: 4px;
}

.practice-card p {
  margin: 0;
  color: var(--fg);
  font-size: 15px;
  line-height: 1.5;
}

.practice-card-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.practice-card-disabled:hover {
  border-color: var(--border);
  transform: none;
}

.coming-soon {
  margin-top: 12px !important;
  font-style: italic;
  color: var(--muted-light);
  font-size: 13px;
}

/* === Длительность === */

.duration-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 32px 0;
}

.duration-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.duration-card:hover {
  border-color: var(--accent);
}

.duration-number {
  font-family: var(--serif);
  font-size: 48px;
  display: inline-block;
  margin-right: 12px;
  vertical-align: baseline;
  line-height: 1;
}
.duration-label {
  font-size: 18px;
  color: var(--muted);
}
.duration-note {
  margin: 12px 0 0 0;
  color: var(--muted);
  font-size: 14px;
}

.duration-warning,
.demo-warning {
  margin-top: 32px;
  padding: 16px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 4px;
  font-size: 14px;
}

/* === Соглашение === */

.agreement .rule-statement {
  font-size: 18px;
  margin: 24px 0;
  padding: 16px;
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}

.agreement-form {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  cursor: pointer;
  font-size: 16px;
}
.checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* === Анкета === */

.survey-form {
  margin-top: 16px;
}

.survey-question {
  border: none;
  padding: 0;
  margin: 0 0 32px 0;
}
.survey-question legend {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 12px;
  padding: 0;
}
.question-number {
  color: var(--muted);
  margin-right: 8px;
}
.survey-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.radio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid transparent;
}
.radio-row:hover {
  background: var(--bg-card);
}
.radio-row input[type="radio"]:checked + span {
  font-weight: 500;
}
.radio-row input[type="radio"] {
  width: 16px;
  height: 16px;
}

.survey-question-error legend {
  color: var(--error);
}

/* === Скрининг === */

.scale-field {
  border: none;
  padding: 0;
  margin: 0 0 32px 0;
}
.scale-field legend {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 12px;
  padding: 0;
}
.scale-slider {
  width: 100%;
  margin: 8px 0;
}
.scale-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.scale-low, .scale-high {
  flex: 1;
}
.scale-high { text-align: right; }
.scale-value {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--fg);
  background: var(--accent-light);
  padding: 4px 12px;
  border-radius: 4px;
  min-width: 40px;
  text-align: center;
}

.reflection-field {
  border: none;
  padding: 0;
  margin: 0 0 32px 0;
}
.reflection-field legend {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 12px;
  padding: 0;
}
.reflection-textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--fg);
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  resize: vertical;
}
.reflection-textarea:focus {
  outline: none;
  border-color: var(--fg);
}

/* === Дашборд === */

.dashboard-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--muted);
}
.practice-name {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--fg);
}
.dashboard-day {
  font-family: var(--mono);
}

.day-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px;
  margin-bottom: 24px;
}
.day-card h2 {
  margin-top: 0;
}

.day-narrative {
  margin: 16px 0 12px 0;
  color: var(--fg);
}

.daypart-hint {
  margin: 0 0 24px 0;
  padding: 8px 12px;
  border-left: 2px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}
.daypart-hint[hidden] {
  display: none;
}

.day-progress {
  margin: 24px 0;
}
.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 4px;
  margin-top: 16px;
}
.progress-label { color: var(--muted); }
.progress-value { font-family: var(--mono); }

.progress-bar {
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}

.day-status {
  margin: 24px 0;
  font-size: 15px;
}
.status-completed {
  color: var(--success);
  font-weight: 500;
}
.status-in-progress {
  color: var(--accent);
}
.status-pending {
  color: var(--muted);
}

.dashboard-meta-info {
  margin-top: 24px;
}
.dashboard-meta-info details {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 14px;
}
.dashboard-meta-info summary {
  cursor: pointer;
  color: var(--muted);
}

.journal-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0 0;
}
.journal-day {
  display: grid;
  grid-template-columns: 80px 100px 1fr 100px;
  gap: 12px;
  padding: 8px 0;
  font-family: var(--mono);
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}
.journal-day:last-child { border-bottom: none; }
.journal-completed .journal-status { color: var(--success); }
.journal-incomplete .journal-status { color: var(--muted); }

/* === Плеер (демо и активный) === */

.player {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
  margin: 24px 0;
}

.player-status {
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 14px;
}
.status-label { color: var(--muted); }
.status-value { margin-left: 8px; }

.player-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.btn {
  font: inherit;
  padding: 10px 20px;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
  border-radius: 4px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.player-meta {
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
}
.meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
  font-family: var(--mono);
}
.meta-label {
  color: var(--muted);
  min-width: 180px;
}
.volume-slider {
  flex: 1;
  max-width: 200px;
}

.day-rules {
  margin-top: 24px;
  padding: 16px;
  background: var(--accent-light);
  border-radius: 4px;
  font-size: 14px;
}
.day-rules p {
  margin: 4px 0;
}
.day-rules .hint {
  color: var(--muted);
  font-size: 13px;
}

/* === Демо-страница (итерация 1) === */

.demo-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.demo-switch {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  text-decoration: none;
  color: var(--muted);
  background: white;
}
.demo-switch:hover {
  border-color: var(--fg);
  color: var(--fg);
}
.demo-switch.active {
  border-color: var(--fg);
  color: var(--fg);
  background: var(--accent-light);
  font-weight: 500;
}

.demo .recipe-details {
  margin: 24px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
}
.recipe-details summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--muted);
}
.recipe-table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 13px;
}
.recipe-table th {
  text-align: left;
  font-weight: 400;
  color: var(--muted);
  padding: 4px 12px 4px 0;
  width: 160px;
}
.recipe-table td { padding: 4px 0; }

.layers-list {
  font-family: var(--mono);
  font-size: 13px;
  padding-left: 20px;
}

/* === Сброс === */

.reset .page-header h1 {
  color: var(--fg);
}
.reset .prose {
  color: var(--fg);
}
.reset-actions {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
.reset-actions .cta {
  margin-bottom: 8px;
}

/* === Результат === */

.result .page-header h1 {
  color: var(--fg);
}
.result-comparison {
  margin: 32px 0;
}
.comparison-svg {
  width: 100%;
  max-width: 720px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.result-disclaimer {
  margin: 32px 0;
  padding: 16px;
  background: var(--accent-light);
  border-radius: 4px;
  font-size: 14px;
  color: var(--muted);
}
.result-disclaimer p { margin: 0; }
.result-reflection {
  margin: 32px 0;
}
.result-reflection h3 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--muted);
}
.reflection-text {
  margin: 0;
  padding: 12px 16px;
  border-left: 2px solid var(--border);
  font-style: italic;
  color: var(--fg);
  white-space: pre-wrap;
}
.result-cta {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}
.cta-link {
  color: var(--muted);
  font-size: 14px;
  text-decoration: underline;
}
.cta-link:hover { color: var(--fg); }
