/* ═══════════════════════════════════════════════
   Fifitly — Unified Buttons
   Токены цветов: css/tokens.css (--*-btn)
   ═══════════════════════════════════════════════ */

/* ── База ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: var(--fs-14-regular, 14px);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform .15s, opacity .15s, background .15s, color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}
.btn:active { transform: scale(0.98); opacity: 0.85; }
.btn:disabled { opacity: 0.4; pointer-events: none; cursor: not-allowed; }

/* ── Форма и размер ───────────────────────────── */
.btn--pill    { border-radius: var(--r-pill, 99px); padding: 12px 22px; }
.btn--rounded { border-radius: 12px; padding: 12px 16px; }
.btn--sm      { padding: 7px 13px; font-size: 13px; font-weight: 500; border-radius: 9px; }
.btn--full    { width: 100%; }
.btn--align-left { justify-content: flex-start; text-align: left; }

/* Нижний блок действий экрана (Питание, Тренировки, Профиль) */
.btn--action {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  border: 0.5px solid var(--border);
  color: var(--text2);
}
.btn--action-accent {
  background: rgba(204, 85, 0, 0.04);
  border-color: rgba(204, 85, 0, 0.25);
  color: #CC5500;
}
.btn--action-accent:active { background: rgba(204, 85, 0, 0.08); }
.btn--action-training {
  border-color: rgba(0, 204, 136, 0.25);
  color: var(--training);
}

.screen-actions {
  display: flex;
  flex-direction: column;
  gap: var(--screen-actions-gap, 8px);
}
.screen-actions--spaced { margin-top: 14px; }
.screen-actions__title {
  font-size: var(--fs-10-regular, 10px);
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font);
  margin-bottom: 2px;
}
.screen-actions__list {
  display: flex;
  flex-direction: column;
  gap: var(--screen-actions-gap, 8px);
}
.screen-actions__footer {
  margin-top: 6px;
  padding: 10px 12px;
  background: rgba(99, 102, 241, 0.12);
  border-radius: 10px;
  font-size: var(--fs-12-regular, 12px);
  color: var(--text3);
  text-align: center;
  font-family: var(--font);
}

/* ── Primary (секционные) ─────────────────────── */
.btn--training,
.modal-btn-primary,
.ds-btn.ds-btn--training,
.ds-btn.ds-btn--accept {
  background: var(--training-btn);
  color: #fff;
  border: none;
}

.btn--nutrition,
.ds-btn.ds-btn--nutrition {
  background: var(--nutrition-btn);
  color: #fff;
  border: none;
}

.btn--water,
.ds-btn.ds-btn--water {
  background: var(--water-btn);
  color: #fff;
  border: none;
}

.btn--sleep,
.ds-btn.ds-btn--sleep {
  background: var(--sleep-btn);
  color: #fff;
  border: none;
}

.btn--brand,
.ds-btn.ds-btn--detail {
  background: var(--brand-btn);
  color: #fff;
  border: none;
}

.btn--cardio,
.ds-btn.ds-btn--cardio {
  background: #B8860B;
  color: #fff;
  border: none;
}

.btn--accent,
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
}

.btn--danger,
.ds-btn.ds-btn--danger,
.ds-btn.ds-btn--reject {
  background: #C0392B;
  color: #fff;
  border: none;
}

/* Мягкий акцент питания (список покупок и т.п.) */
.btn--nutrition-soft,
.shop-trigger-btn {
  background: rgba(204, 85, 0, 0.04);
  border: 0.5px solid rgba(204, 85, 0, 0.25);
  color: #CC5500;
  font-size: 13px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 12px;
}
.btn--nutrition-soft:active,
.shop-trigger-btn:active {
  background: rgba(204, 85, 0, 0.08);
}

/* ── Secondary / ghost ────────────────────────── */
.btn--secondary,
.btn-secondary,
.ds-btn.ds-btn--cancel {
  background: var(--card-bg);
  border: 0.5px solid var(--border);
  color: var(--text2);
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 11px;
}

.modal-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text3);
  font-weight: 500;
  padding: 12px;
  border-radius: var(--r-pill, 99px);
}

.btn--ghost {
  background: none;
  border: none;
  color: var(--text3);
  font-weight: 500;
  padding: 4px 6px;
}
.btn--ghost:hover { color: var(--text2); }

.btn--link {
  background: none;
  border: none;
  color: var(--accent, #5DCAA5);
  font-size: 13px;
  font-weight: 400;
  padding: 0;
  text-decoration: underline;
}

.btn--play {
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
  flex-shrink: 0;
}

.btn--training-outline {
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--training);
}

.btn--danger-text {
  color: #ff6b6b;
}

/* ── Icon / close ─────────────────────────────── */
.btn--icon,
.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  background: var(--card-bg);
  border: 0.5px solid var(--border);
  color: var(--text2);
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.btn--close,
.modal-close,
.sheet-close,
.train-page-close,
.btn-close-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: 32px;
  min-height: 32px;
  padding: 4px 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text3);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}
.btn--close:hover,
.modal-close:hover,
.sheet-close:hover,
.train-page-close:hover,
.btn-close-x:hover { color: rgba(255, 255, 255, 0.55); }

.btn--icon-round {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  background: none;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: var(--text3);
  font-size: 16px;
}

/* ── Design system aliases (editor) ───────────── */
.ds-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--r-pill, 99px);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: transform .15s, opacity .15s;
}
.ds-btn:active { transform: scale(0.98); opacity: 0.85; }

/* ── Legacy full-width primary/secondary ──────── */
.btn-primary,
.modal-btn-primary {
  width: 100%;
  padding: 12px;
  border-radius: var(--r-pill, 99px);
  font-size: var(--fs-14-regular, 14px);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
}
.btn-primary:active,
.modal-btn-primary:active { transform: scale(0.98); opacity: 0.8; }

.btn-secondary,
.modal-btn-secondary {
  width: 100%;
  cursor: pointer;
  font-family: var(--font);
}

/* ── Light theme ──────────────────────────────── */
body.theme-light .btn--icon,
body.theme-light .icon-btn {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
}
