/* ============================================================
   Индивидуальный план eo ASSIST — стили страницы
   Mobile-first. Все брендовые значения вынесены
   в custom properties — менять оформление в одном месте.
   ============================================================ */

:root {
  /* Брендовая палитра (совпадает с theme/brandColors.ts приложения) */
  --color-bg: #eef0f3;              /* фон вокруг «листа» */
  --color-surface: #ffffff;         /* фон листа и карточек */
  --color-primary: #9e56b2;         /* насыщенный фиолетовый (акцент) */
  --color-primary-soft: #bd8bca;    /* светлый фиолетовый */
  --color-primary-tint: #f7f2f9;    /* очень светлая лаванда (подложки) */
  --color-border: rgba(158, 86, 178, 0.28);
  --color-border-soft: rgba(158, 86, 178, 0.16);
  --color-text: #3f4a57;            /* основной текст */
  --color-text-heading: #2e3742;    /* заголовки */
  --color-text-muted: #8a94a3;      /* подписи, вторичный текст */

  /* Типографика */
  --font-main: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-brand: 'Raleway', var(--font-main);
  --font-serif: 'PT Serif', Georgia, 'Times New Roman', serif;

  /* Геометрия */
  --radius-sheet: 28px;
  --radius-card: 16px;
  --radius-pill: 999px;
  --page-max-width: 480px;
  --page-gutter: 20px;

  /* Тени */
  --shadow-card: 0 1px 2px rgba(73, 85, 99, 0.06);
  --shadow-bar: 0 -6px 24px rgba(73, 85, 99, 0.10);
}

/* ---------- Сброс ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Иконки из inline-спрайта */
.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- Каркас страницы ---------- */

.sheet {
  max-width: var(--page-max-width);
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
}

@media (min-width: 520px) {
  .sheet {
    min-height: 0;
    margin: 24px auto;
    border-radius: var(--radius-sheet);
    box-shadow: 0 12px 48px rgba(73, 85, 99, 0.12);
    overflow: hidden;
  }
}

.sheet__content {
  flex: 1;
  padding: 0 var(--page-gutter) 24px;
}

/* ---------- Шапка ---------- */

.site-header {
  padding: 20px var(--page-gutter) 14px;
  border-bottom: 1px solid var(--color-border-soft);
}

.logo {
  height: 26px;
  width: auto;
  user-select: none;
}

/* ---------- Консультант ---------- */

.consultant {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.consultant__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-primary-soft);
}

.consultant__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-heading);
}

.consultant__role {
  margin-top: 2px;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ---------- Заголовок плана ---------- */

.plan-title {
  margin-top: 24px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.3;
  color: var(--color-text-heading);
}

.plan-title__accent {
  color: var(--color-primary);
}

/* ---------- Рекомендованные масла (сводка) ---------- */

.oils-summary {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 16px;
  background: var(--color-primary-tint);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-card);
}

.oils-summary__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 12px;
  color: var(--color-primary);
}

.oils-summary__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-heading);
}

.oils-summary__list {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text);
}

/* ---------- План использования ---------- */

.plan {
  margin-top: 28px;
}

.plan__heading {
  font-family: var(--font-main);
  font-size: 21px;
  font-weight: 700;
  color: var(--color-text-heading);
}

.plan__lead {
  margin-top: 4px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.plan__list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* --- Пункт плана (аккордеон) --- */

.plan-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.plan-item__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* прячем стандартный маркер details */
.plan-item__summary::-webkit-details-marker {
  display: none;
}

.plan-item__summary {
  list-style: none;
}

.plan-item__heading {
  flex: 1;
  min-width: 0;
}

.plan-item__title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-heading);
}

.plan-item__subtitle {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.plan-item__chevron {
  color: var(--color-primary);
  transition: transform 0.25s ease;
}

.plan-item[open] > .plan-item__summary .plan-item__chevron {
  transform: rotate(180deg);
}

.plan-item[open] {
  background: var(--color-primary-tint);
}

.plan-item__body {
  padding: 4px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ai-response {
  width: 100%;
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.ai-response b,
.ai-response strong {
  display: inline-block;
  margin-top: 12px;
  color: var(--color-text-heading);
  font-size: 15px;
}

.ai-response b:first-child,
.ai-response strong:first-child {
  margin-top: 0;
}

.ai-response p + p,
.ai-response ul,
.ai-response ol,
.ai-response pre {
  margin-top: 10px;
}

.ai-response ul,
.ai-response ol {
  padding-left: 20px;
  list-style: initial;
}

.ai-response li + li {
  margin-top: 4px;
}

.ai-response i,
.ai-response em {
  color: var(--color-text-muted);
}

.ai-response a {
  color: var(--color-primary);
  text-decoration: underline;
}

.ai-response pre,
.ai-response code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* --- Блок внутри пункта (иконка + текст) --- */

.plan-block {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.plan-block__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 12px;
  color: var(--color-primary);
}

/* Иконки блоков внутри текста рекомендаций ВРЕМЕННО скрыты
   (разметка остаётся на месте). Чтобы вернуть — удалить правило ниже. */
.plan-block__icon {
  display: none;
}

.plan-block__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-heading);
}

.plan-block__text,
.plan-block__list {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text);
}

.plan-block__list li {
  position: relative;
  padding-left: 16px;
}

.plan-block__list li + li {
  margin-top: 4px;
}

.plan-block__list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-primary-soft);
}

/* ---------- Дисклеймер ---------- */

.disclaimer {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.disclaimer .icon {
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
}

/* ---------- Футер сайта ---------- */

.site-footer {
  margin-top: 8px;
  padding: 24px var(--page-gutter) 22px;
  border-top: 1px solid var(--color-border-soft);
  text-align: center;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 7px 16px 7px 13px;
  background: #000;
  color: #fff;
  border: 1px solid #a6a6a6;
  border-radius: 8px;
  text-align: left;
  transition: filter 0.15s ease;
}

.store-badge:active {
  filter: brightness(1.25);
}

.store-badge__icon {
  width: 26px;
  height: 26px;
  flex: none;
}

.store-badge__hint {
  display: block;
  font-size: 10px;
  line-height: 1.15;
  letter-spacing: 0.02em;
  opacity: 0.9;
}

.store-badge__store {
  display: block;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.site-footer__copyright {
  margin-top: 16px;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ---------- Нижняя панель CTA ---------- */

.cta-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  gap: 12px;
  padding: 12px var(--page-gutter);
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-soft);
  box-shadow: var(--shadow-bar);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: filter 0.15s ease, background-color 0.15s ease;
  cursor: pointer;
}

.btn .icon {
  width: 19px;
  height: 19px;
}

@media (max-width: 374px) {
  .cta-bar {
    gap: 8px;
  }

  .btn {
    font-size: 13px;
    gap: 6px;
    padding: 10px 10px;
  }
}

.btn--primary {
  flex: 1.2;
  background: var(--color-primary);
  color: #fff;
}

.btn--primary:active {
  filter: brightness(0.92);
}

.btn--outline {
  flex: 1;
  border: 1.5px solid var(--color-border);
  color: var(--color-text-heading);
  background: var(--color-surface);
}

.btn--outline:active {
  background: var(--color-primary-tint);
}

/* ---------- Доступность / прочее ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
