/* ============================================================
   PAGES.CSS — стили конкретных страниц + калькулятор v2
   ============================================================ */

/* ============================================================
   ГЛАВНАЯ (index.html)
   ============================================================ */
.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-h) - var(--footer-h));
  padding: 40px 0;
}

.home__title {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.home__subtitle {
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 48px;
  max-width: 520px;
}

.home__tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
}

/* ============================================================
   ВНУТРЕННИЕ СТРАНИЦЫ
   ============================================================ */
.page-header {
  margin-bottom: 32px;
}

.page-header__title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  margin-bottom: 8px;
}

.page-header__subtitle {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 720px;
}

/* Кнопка "Назад" */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-muted);
  background: transparent;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
  margin-bottom: 20px;
}

.back-btn:hover {
  background: rgba(0, 229, 255, 0.08);
  color: var(--accent-cyan);
}

.back-btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================================
   ABOUT (about.html)
   ============================================================ */
.about__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.about__cta {
  max-width: 400px;
  margin: 0 auto;
}

/* ============================================================
   MOBILE (mobile.html) — эмулятор телефона
   ============================================================ */
.phone-frame {
  width: 290px;
  height: 560px;
  margin: 0 auto 32px;
  padding: 10px;
  background: var(--bg-header);
  border: 3px solid var(--border-medium);
  border-radius: 40px;
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.15);
}

.phone-frame__inner {
  width: 100%;
  height: 100%;
  background: var(--bg-card-2);
  border-radius: 30px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   BOTS (bots.html) — эмулятор Telegram
   ============================================================ */
.tg-chat {
  max-width: 480px;
  margin: 0 auto 32px;
  background: #0e1621;
  border: 1.5px solid rgba(0, 229, 255, 0.35);
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(0, 229, 255, 0.15);
  overflow: hidden;
}

.tg-chat__header {
  padding: 12px 14px;
  background: #17212b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tg-chat__body {
  padding: 18px 14px;
  min-height: 260px;
}

.tg-chat__input {
  padding: 10px 14px;
  background: #17212b;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
}

/* ============================================================
   WEB (web.html) — эмулятор браузера
   ============================================================ */
.browser-frame {
  background: var(--bg-card-2);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  margin-bottom: 32px;
}

.browser-frame__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  background: #22222e;
}

.browser-frame__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.browser-frame__dot--red {
  background: #ff5f57;
}
.browser-frame__dot--yellow {
  background: #ffbd2e;
}
.browser-frame__dot--green {
  background: #28c840;
}

.browser-frame__url {
  flex: 1;
  margin-left: 16px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.browser-frame__body {
  padding: 24px;
  min-height: 450px;
}

/* ============================================================
   CALCULATOR (calculator.html) v2
   ============================================================ */

/* ----- Большие табы ----- */
.calc-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}

.calc-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.calc-tab svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.calc-tab:hover {
  border-color: var(--border-medium);
  color: var(--text-main);
  transform: translateY(-2px);
}

.calc-tab:hover svg {
  transform: scale(1.1);
}

.calc-tab.is-active {
  background: linear-gradient(
    135deg,
    rgba(0, 229, 255, 0.15),
    rgba(0, 229, 255, 0.05)
  );
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 8px 24px -8px rgba(0, 229, 255, 0.4);
}

/* ----- Layout ----- */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

.calc-side {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  background: var(--bg-header);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ----- Переключатель валют ----- */
.currency-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.currency-btn {
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.currency-btn:hover {
  color: var(--text-main);
}

.currency-btn.is-active {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 2px 8px rgba(0, 229, 255, 0.3);
}

/* ----- Бюджет ----- */
.calc-budget {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #1f1f2c, #13131a);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: var(--radius-lg);
}

.calc-budget__label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.calc-budget__value {
  font-size: 30px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 6px;
  line-height: 1.1;
}

.calc-budget__deadline {
  font-size: 11px;
  color: var(--text-faint);
}

/* ----- Опции ----- */
.calc-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card-2);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.calc-option:hover {
  border-color: var(--border-medium);
  background: var(--bg-card);
}

.calc-option.is-active {
  background: rgba(0, 229, 255, 0.1);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.08);
}

.calc-option__check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--text-faint);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: transparent;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.calc-option.is-active .calc-option__check {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #000;
}

.calc-option__label {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  color: var(--text-main);
}

.calc-option__label strong {
  font-weight: 600;
}

.calc-option__label small {
  font-size: 12px;
  color: var(--text-dim);
}

.calc-option__price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.calc-option.is-active .calc-option__price {
  color: var(--accent-cyan);
}

/* ----- Функции ----- */
.calc-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.calc-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card-2);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.calc-feature:hover {
  border-color: var(--border-medium);
  background: var(--bg-card);
}

.calc-feature.is-active {
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.6);
}

.calc-feature__check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-faint);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: transparent;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.calc-feature.is-active .calc-feature__check {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #000;
}

.calc-feature__label {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.3;
}

.calc-feature__price {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.calc-feature.is-active .calc-feature__price {
  color: var(--accent-cyan);
}

/* ----- Срочность (тумблер) ----- */
.calc-urgent {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(
    135deg,
    rgba(251, 191, 36, 0.08),
    rgba(251, 191, 36, 0.02)
  );
  border: 1.5px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.calc-urgent:hover {
  border-color: rgba(251, 191, 36, 0.5);
}

.calc-urgent.is-active {
  background: linear-gradient(
    135deg,
    rgba(251, 191, 36, 0.15),
    rgba(251, 191, 36, 0.05)
  );
  border-color: var(--accent-amber);
  box-shadow: 0 4px 16px -4px rgba(251, 191, 36, 0.4);
}

.calc-urgent__icon {
  font-size: 26px;
  line-height: 1;
}

.calc-urgent__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calc-urgent__text strong {
  font-size: 14px;
  color: var(--text-main);
}

.calc-urgent__text small {
  font-size: 11px;
  color: var(--text-dim);
}

.calc-urgent__toggle {
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  position: relative;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.calc-urgent.is-active .calc-urgent__toggle {
  background: var(--accent-amber);
}

.calc-urgent__slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.calc-urgent.is-active .calc-urgent__slider {
  transform: translateX(20px);
}

/* ----- Разбивка бюджета ----- */
.calc-breakdown {
  margin-top: 24px;
  padding: 18px 20px;
  background: var(--bg-card-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.calc-breakdown h4 {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.calc-breakdown__row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.calc-breakdown__row:last-child {
  border-bottom: none;
}

.calc-breakdown__row--accent {
  color: var(--accent-amber);
  font-weight: 600;
  border-top: 1px solid rgba(251, 191, 36, 0.2);
  margin-top: 6px;
  padding-top: 12px;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--transition),
    visibility var(--transition);
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal__content {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--bg-header);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal__content h3 {
  margin-bottom: 6px;
  font-size: 20px;
}

.modal__content > p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-dim);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.modal__actions .btn {
  height: 46px;
  font-size: 13px;
}

/* ============================================================
   Адаптив калькулятора
   ============================================================ */
@media (max-width: 1024px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }

  .calc-side {
    position: static;
    order: -1;
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .calc-tabs {
    grid-template-columns: 1fr;
  }

  .calc-tab {
    padding: 14px 16px;
    font-size: 13px;
    justify-content: flex-start;
  }

  .calc-tab svg {
    width: 20px;
    height: 20px;
  }

  .calc-features {
    grid-template-columns: 1fr;
  }

  .calc-budget__value {
    font-size: 26px;
  }

  .modal__actions {
    grid-template-columns: 1fr;
  }
}
