/* ════════════════════════════════════════════
   COMPONENTS — Buttons · Forms · Nav · Toast
   ═════════════════════════════════════════════ */

/* ── Blue link (for Instagram, etc.) ── */
.link--blue {
  color: var(--blue);
  text-decoration: none;
  transition: opacity var(--duration-fast);
}

.link--blue:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ── Buttons ── */
.btn--submit {
  width: 100%;
  padding: 14px 28px;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background var(--duration-fast), transform var(--duration-fast);
}

.btn--submit:hover {
  background: var(--accent-dim);
}

.btn--submit:active {
  transform: scale(0.98);
}

/* ── Nav button ── */
.nav-btn {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0 18px;
  height: 100%;
  border-radius: 0;
  position: relative;
  white-space: nowrap;
  transition: color var(--duration-fast);
}

.nav-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transition: transform var(--duration-base) cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn:hover {
  color: var(--white);
}

.nav-btn.is-active {
  color: var(--white);
}

.nav-btn.is-active::after {
  transform: scaleX(1);
}

/* ── CTA-кнопка в шапке («Записаться») ── */
.nav-btn--cta {
  background: var(--accent);
  color: #fff;
  padding: 10px 24px;
  height: auto;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.nav-btn--cta::after {
  display: none;
}

.nav-btn--cta:hover {
  background: var(--accent-dim);
  color: #fff;
}

.nav-btn--cta.is-active {
  background: var(--accent-dim);
  color: #fff;
}

/* ── Form controls ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
}

.field__input,
.field__select,
.field__textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  color: var(--white);
  font-size: 14px;
  outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  -webkit-appearance: none;
}

.field__input:focus,
.field__select:focus,
.field__textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 38, 185, 0.15);
}

.field__select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23777' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.field__select option {
  background: var(--bg-3);
}

.field__select:invalid {
  color: var(--text-dim);
}

.field__input::placeholder,
.field__textarea::placeholder {
  color: var(--text-dim);
}

.field__textarea {
  resize: vertical;
  min-height: 100px;
}

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

.field__note a {
  color: var(--text-dim);
  text-decoration: underline;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  z-index: var(--z-modal);
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast--success {
  border-color: #22c55e;
}

.toast--error {
  border-color: var(--accent);
}

/* ── Mobile nav drawer ── */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(320px, 85vw);
  height: 100vh;
  background: var(--bg-2);
  z-index: var(--z-mobile-nav);
  padding: 80px 24px 40px;
  border-left: 1px solid var(--border);
  transition: right var(--nav-speed) cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.mobile-nav.is-open {
  right: 0;
}

.mobile-nav__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav .nav-btn {
  width: 100%;
  text-align: left;
  height: auto;
  padding: 14px 16px;
  font-size: 15px;
  border-radius: 6px;
}

.mobile-nav .nav-btn:hover,
.mobile-nav .nav-btn.is-active {
  background: var(--bg-3);
  color: var(--white);
}

.mobile-nav .nav-btn::after {
  display: none;
}

/* Backdrop */
.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  z-index: calc(var(--z-mobile-nav) - 5);
}

.backdrop.is-open {
  display: block;
}

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  z-index: var(--z-backdrop);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  position: relative;
  animation: modal-in var(--modal-speed) cubic-bezier(0.22, 1, 0.36, 1);
}

.modal--photo {
  max-width: 90vw;
  padding: 0;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__photo {
  display: block;
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal--photo .modal__close {
  top: -48px;
  right: 0;
  color: var(--white);
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  /* 44×44 — минимальная кликабельная область по WCAG 2.2 AA */
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: var(--white);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  transition: background var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__nav:hover {
  background: rgba(0, 0, 0, 0.8);
}

.modal__nav--prev {
  left: -60px;
}

.modal__nav--next {
  right: -60px;
}

@media (max-width: 900px) {
  .modal__nav--prev {
    left: 8px;
  }

  .modal__nav--next {
    right: 8px;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.93) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  /* 44×44 кликабельная область при том же визуальном размере символа */
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-base);
}

.modal__close:hover {
  color: var(--white);
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Design-system primitive: базовая поверхность-карточка ──
   .chron-card, .promo-card и .card (тарифы/сообщество) визуально почти
   идентичны (тёмная поверхность, тонкая обводка, подсветка при hover),
   но раньше дублировали эти правила по отдельности. Общая база — здесь,
   индивидуальные свойства (border-radius, padding, transform на hover
   и т.п.) остаются в css/sections/*.css у каждого конкретного варианта. */
.surface-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  transition: border-color var(--duration-base);
}

.surface-card:hover {
  border-color: var(--accent-dim);
}