/* ===== PREMIUM DARK & GOLD THEME ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ---- CSS-переменные тем (тёмная по умолчанию) ---- */
:root {
  --bg-body: radial-gradient(circle at top right, #1a1f3a 0%, #0a0e27 100%);
  --text-main: #ffffff;
  --text-muted: #f4e5c2;
  --gold: #d4af37;
  --gold-deep: #aa8a2e;
  --header-bg: rgba(10, 14, 39, 0.85);
  --container-bg: rgba(26, 31, 58, 0.6);
  --panel-bg: rgba(10, 14, 39, 0.4);
  --panel-bg-strong: rgba(10, 14, 39, 0.6);
  --input-bg: rgba(10, 14, 39, 0.6);
  --input-bg-focus: rgba(10, 14, 39, 0.8);
  --gold-tint: rgba(212, 175, 55, 0.08);
  --gold-tint-hover: rgba(212, 175, 55, 0.15);
  --gold-border: rgba(212, 175, 55, 0.2);
  --gold-border-strong: rgba(212, 175, 55, 0.3);
  --btn-dark-text: #0a0e27;
  --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --placeholder: rgba(244, 229, 194, 0.5);
  --option-text: #0a0e27;
  --option-bg: #f4e5c2;
  --red: #ff6b6b;
  --green: #10b981;
}

/* ---- Светлая тема ---- */
body.light {
  --bg-body: radial-gradient(circle at top right, #f7f2e4 0%, #ece4cf 100%);
  --text-main: #141a35;
  --text-muted: #5b5442;
  --gold: #9a7b1f;
  --gold-deep: #7d6216;
  --header-bg: rgba(255, 255, 255, 0.85);
  --container-bg: rgba(255, 255, 255, 0.75);
  --panel-bg: rgba(240, 233, 214, 0.6);
  --panel-bg-strong: rgba(244, 238, 222, 0.85);
  --input-bg: rgba(255, 255, 255, 0.9);
  --input-bg-focus: #ffffff;
  --gold-tint: rgba(154, 123, 31, 0.08);
  --gold-tint-hover: rgba(154, 123, 31, 0.16);
  --gold-border: rgba(154, 123, 31, 0.25);
  --gold-border-strong: rgba(154, 123, 31, 0.4);
  --btn-dark-text: #ffffff;
  --card-shadow: 0 20px 60px rgba(120, 100, 40, 0.15);
  --placeholder: rgba(91, 84, 66, 0.55);
  --option-text: #141a35;
  --option-bg: #ffffff;
  --red: #c0392b;
  --green: #0a8f5f;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  background: var(--bg-body);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text-main);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ===== ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ ===== */.theme-toggle {
  background: var(--gold-tint);
  color: var(--gold);
  border: 1px solid var(--gold-border-strong);
  border-radius: 50px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: all 0.3s ease;
}
.theme-toggle:hover {
  background: var(--gold-tint-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 15px var(--gold-tint-hover);
}

/* ===== ШАПКА ===== */
.header {
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 15px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--gold-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 30px; }

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  text-shadow: 0 0 15px var(--gold-border-strong);
  letter-spacing: 1px;
}

/* Логотип: картинка + текст */
.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  line-height: 1;
}

.logo-img {
  height: 45px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 8px var(--gold-border-strong));
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  color: #d4af37;
  white-space: nowrap;
  letter-spacing: 1px;
  text-shadow: 0 0 15px var(--gold-border-strong);
}

.nav { display: flex; gap: 10px; }

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.nav a:hover {
  color: var(--gold);
  background: var(--gold-tint);
  border-color: var(--gold-border-strong);
}

.header-right { display: flex; align-items: center; gap: 12px; }
.auth-status { display: flex; align-items: center; gap: 12px; }
.user-name { color: var(--gold); font-weight: 600; }

/* ===== КНОПКИ ===== */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  font-size: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--btn-dark-text);
  font-weight: 700;
}

.btn-primary:hover {
  box-shadow: 0 0 20px var(--gold-border-strong);
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(231, 76, 60, 0.2);
  color: var(--red);
  border: 1px solid rgba(231, 76, 60, 0.4);
}

.btn-danger:hover {
  background: rgba(231, 76, 60, 0.4);
}

/* ===== КОНТЕЙНЕР (Стеклянная карточка) ===== */
.container {
  max-width: 950px;
  margin: 40px auto;
  background: var(--container-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--gold-tint-hover);
}

/* ===== ЗАГОЛОВКИ ===== */
h1 {
  color: var(--text-main);
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

h2 {
  color: var(--gold);
  margin-top: 30px;
  margin-bottom: 15px;
  font-size: 22px;
  font-weight: 600;
  border-bottom: 1px solid var(--gold-border);
  padding-bottom: 10px;
}

/* ===== ФОРМЫ ===== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 25px 0;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 14px;
}

input, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gold-border-strong);
  border-radius: 10px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text-main);
  transition: all 0.3s ease;
}

input::placeholder { color: var(--placeholder); }

input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 15px var(--gold-tint-hover);
  background: var(--input-bg-focus);
}

input option { color: var(--option-text); background: var(--option-bg); }

.checkbox-group {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--gold-tint);
  border-radius: 10px;
  border: 1px solid var(--gold-border);
}

.checkbox-group input { width: auto; }
.checkbox-group label { margin: 0; color: var(--text-main); }

.commission-fields {
  grid-column: 1 / -1;
  display: none;
  gap: 15px;
  background: var(--panel-bg);
  padding: 18px;
  border-radius: 10px;
  border: 1px solid var(--gold-border);
}

.commission-fields.active { display: grid; grid-template-columns: 1fr 1fr; }

/* ===== БЛОК РЕЗУЛЬТАТОВ (отдельно от кнопки «Рассчитать») ===== */
.results-block {
  margin-top: 40px;
  padding: 25px;
  background: var(--panel-bg);
  border-radius: 16px;
  border: 1px solid var(--gold-border);
}

/* Подтверждаём блочный поток: кнопка строго на своей строке, ниже формы */
.form-grid { display: grid; }
#results { display: block; }

/* ===== КНОПКА РАССЧИТАТЬ ===== */
.calc-btn {
  display: block;
  clear: both;
  width: 100%;
  max-width: 950px;
  margin: 30px auto 0;
  padding: 16px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--btn-dark-text);
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.calc-btn:hover {
  box-shadow: 0 0 25px var(--gold-border-strong);
  transform: translateY(-2px);
}

/* ===== КАРТОЧКИ ИТОГОВ ===== */
.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin: 25px 0;
}

.summary-card {
  background: var(--gold-tint);
  color: var(--text-main);
  padding: 25px 20px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid var(--gold-border);
  transition: all 0.3s ease;
}

.summary-card:hover {
  transform: translateY(-5px);
  background: var(--gold-tint-hover);
  border-color: var(--gold-border-strong);
}

.summary-card .value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 8px;
  color: var(--gold);
}

.summary-card .label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== ТАБЛИЦА ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: var(--panel-bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--gold-tint-hover);
}

th, td {
  padding: 14px 12px;
  text-align: center;
  border-bottom: 1px solid var(--gold-tint);
  color: var(--text-muted);
  font-size: 14px;
}

th {
  background: var(--gold-tint-hover);
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
}

tr:hover { background: var(--gold-tint); }

/* ===== БЛОК ДЕЙСТВИЙ ===== */
.action-buttons {
  margin-top: 25px;
  padding: 20px;
  background: var(--panel-bg-strong);
  border-radius: 14px;
  display: none;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid var(--gold-border);
}

.action-buttons.visible { display: flex; }
.action-buttons input { flex: 1; min-width: 200px; }

.action-buttons button {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-buttons button:hover { transform: translateY(-2px); }

.btn-save {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--btn-dark-text);
}

.btn-pdf {
  background: rgba(231, 76, 60, 0.2);
  color: var(--red);
  border: 1px solid rgba(231, 76, 60, 0.4);
}

.btn-pdf:hover { background: rgba(231, 76, 60, 0.4); }

/* ===== УТИЛИТЫ ===== */
.hidden { display: none !important; }

.login-hint {
  background: var(--gold-tint);
  padding: 15px;
  border-radius: 10px;
  margin-top: 15px;
  text-align: center;
  color: var(--text-muted);
  border: 1px solid var(--gold-border-strong);
}

.login-hint a { color: var(--gold); font-weight: 600; }

/* ===== ЛИЧНЫЙ КАБИНЕТ ===== */
.user-info {
  background: var(--gold-tint);
  padding: 25px;
  border-radius: 16px;
  margin-bottom: 25px;
  border: 1px solid var(--gold-border);
}

.user-info h2 { margin: 0 0 5px 0; color: var(--text-main); border: none; padding: 0; }
.user-info p { margin: 0; color: var(--text-muted); }

.calculations-list { display: grid; gap: 18px; }

.calculation-card {
  background: var(--container-bg);
  color: var(--text-main);
  padding: 25px;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  border: 1px solid var(--gold-tint-hover);
  transition: all 0.3s ease;
}

.calculation-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-border-strong);
  box-shadow: var(--card-shadow);
}

.calculation-info h3 { margin: 0 0 10px 0; font-size: 20px; color: var(--gold); }
.calculation-info p { margin: 6px 0; color: var(--text-muted); font-size: 14px; }

.calculation-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.calculation-actions button {
  background: var(--gold-tint);
  color: var(--gold);
  border: 1px solid var(--gold-border-strong);
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.calculation-actions button:hover {
  background: var(--gold-tint-hover);
}

.calculation-actions button.del-btn {
  background: rgba(231, 76, 60, 0.15);
  color: var(--red);
  border-color: rgba(231, 76, 60, 0.3);
}

.calculation-actions button.del-btn:hover {
  background: rgba(231, 76, 60, 0.3);
}

.calculation-actions button.pdf-btn {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.3);
}

.calculation-actions button.pdf-btn:hover {
  background: rgba(16, 185, 129, 0.3);
}

.empty-state {
  text-align: center;
  padding: 50px 30px;
  color: var(--text-muted);
  background: var(--panel-bg);
  border-radius: 16px;
  border: 1px dashed var(--gold-border-strong);
}

.empty-state a { color: var(--gold); font-weight: 600; }

/* ===== СТРАНИЦА ВХОДА ===== */
.tabs {
  display: flex;
  margin-bottom: 25px;
  background: var(--panel-bg-strong);
  border-radius: 10px;
  padding: 5px;
  border: 1px solid var(--gold-border);
}

.tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.tab.active {
  background: var(--gold-border);
  color: var(--gold);
  border: 1px solid var(--gold-border-strong);
}

#loginForm, #registerForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#loginForm button[type="submit"],
#registerForm button[type="submit"] {
  width: 100%;
  padding: 16px;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--btn-dark-text);
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#loginForm button[type="submit"]:hover,
#registerForm button[type="submit"]:hover {
  box-shadow: 0 0 25px var(--gold-border-strong);
  transform: translateY(-2px);
}

.already-logged button {
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--btn-dark-text);
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.already-logged button:hover {
  box-shadow: 0 0 18px var(--gold-border-strong);
  transform: translateY(-1px);
}

.result {
  margin-top: 15px;
  padding: 14px;
  border-radius: 10px;
  font-size: 14px;
  background: var(--panel-bg-strong);
  color: var(--text-main);
  border: 1px solid var(--gold-border);
}

.result.error { background: rgba(231, 76, 60, 0.15); border-color: rgba(231, 76, 60, 0.4); color: var(--red); }
.result.success { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.4); color: var(--green); }

/* ===== ГЛАВНАЯ СТРАНИЦА (LANDING) ===== */
.hero {
  max-width: 950px;
  margin: 80px auto;
  background: var(--container-bg);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 60px 40px;
  text-align: center;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--gold-border);
}

.hero h1 { font-size: 42px; margin-bottom: 15px; color: var(--text-main); }
.hero p { color: var(--text-muted); font-size: 18px; margin-bottom: 35px; max-width: 600px; margin-left: auto; margin-right: auto; }

.hero .btn { padding: 14px 30px; font-size: 16px; margin: 5px; }

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
  text-align: left;
}

.feature {
  padding: 25px;
  background: var(--panel-bg);
  border-radius: 16px;
  border: 1px solid var(--gold-tint-hover);
  transition: all 0.3s ease;
}

.feature:hover {
  background: var(--gold-tint);
  border-color: var(--gold-border-strong);
  transform: translateY(-5px);
}

.feature h3 { color: var(--gold); margin-bottom: 10px; font-size: 18px; }
.feature p { color: var(--text-muted); font-size: 14px; }


/* ===== УТИЛИТЫ ТЕМ (для динамических блоков) ===== */
.t-gold { color: var(--gold) !important; }
.t-muted { color: var(--text-muted) !important; }
.t-main { color: var(--text-main) !important; }
.t-green { color: var(--green) !important; }
.t-red { color: var(--red) !important; }
.bg-panel { background: var(--panel-bg-strong) !important; }
/* ===== PDF ШАБЛОН (ОСТАЁТСЯ БЕЛЫМ ДЛЯ ПЕЧАТИ) ===== */
.pdf-template { position: absolute; left: -9999px; top: 0; width: 800px; min-height: 1100px; background: white; padding: 40px; font-family: 'Segoe UI', Arial, sans-serif; color: #333; }
.pdf-template h1 { color: #0a0e27; text-align: center; margin-bottom: 10px; font-size: 28px; }
.pdf-template .subtitle { text-align: center; color: #666; margin-bottom: 30px; }
.pdf-template h2 { color: #d4af37; margin: 25px 0 15px 0; font-size: 20px; border-bottom: 2px solid #d4af37; padding-bottom: 5px; }
.pdf-template .params { background: #f8f9fa; padding: 20px; border-radius: 12px; margin-bottom: 20px; border-left: 4px solid #d4af37; }
.pdf-template .params p { margin: 8px 0; font-size: 14px; color: #333; }
.pdf-template .params strong { color: #0a0e27; }
.pdf-template .summary-row { display: flex; gap: 15px; margin: 20px 0; }
.pdf-template .summary-item { flex: 1; background: #0a0e27; color: #d4af37; padding: 20px; border-radius: 12px; text-align: center; }
.pdf-template .summary-item .label { font-size: 13px; opacity: 0.8; margin-bottom: 5px; color: #f4e5c2; }
.pdf-template .summary-item .value { font-size: 24px; font-weight: bold; }
.pdf-template table { width: 100%; border-collapse: collapse; margin-top: 15px; background: white; }
.pdf-template th, .pdf-template td { padding: 10px; text-align: center; border: 1px solid #ddd; font-size: 13px; color: #333; }
.pdf-template th { background: #0a0e27; color: #d4af37; }
.pdf-template .footer { text-align: center; margin-top: 30px; color: #999; font-size: 12px; }
.pdf-watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-35deg); font-size: 120px; font-weight: bold; color: rgba(10, 14, 39, 0.05); white-space: nowrap; pointer-events: none; z-index: 0; letter-spacing: 10px; }
.pdf-content { position: relative; z-index: 1; }
/* ============================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================ */

/* Планшеты и маленькие десктопы (до 768px) */
@media (max-width: 768px) {
  
  /* Шапка: логотип и меню в колонку */
  .header {
    flex-direction: column;
    padding: 15px 20px;
    gap: 15px;
  }
  /* Графики в админке */
@media (max-width: 768px) {
  .summary-card canvas {
    max-height: 250px;
  }
}
  .header-left {
    width: 100%;
    justify-content: space-between;
  }
  
  .nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
  }
  
  .nav a {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  .header-right {
    width: 100%;
    justify-content: center;
  }
  
  /* Контейнер: уменьшаем отступы */
  .container {
    margin: 20px 15px;
    padding: 25px 20px;
    border-radius: 16px;
  }
  
  /* Заголовки */
  h1 { font-size: 26px; }
  h2 { font-size: 20px; }
  
  /* Формы: одна колонка */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* Карточки итогов: одна колонка */
  .summary {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .summary-card {
    padding: 20px 15px;
  }
  
  .summary-card .value {
    font-size: 24px;
  }
  
  /* Главная страница */
  .hero {
    margin: 30px 15px;
    padding: 40px 25px;
  }
  
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  
  .features {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  /* Карточки пользователей/расчётов */
  .calculation-card {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .calculation-actions {
    width: 100%;
    justify-content: flex-start;
  }
  
  /* Блок действий (сохранить/PDF) */
  .action-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  .action-buttons input {
    width: 100% !important;
    margin-right: 0;
    margin-bottom: 10px;
  }
  
  .action-buttons button {
    width: 100%;
  }
}

/* Мобильные телефоны (до 480px) */
@media (max-width: 480px) {
  
  .header {
    padding: 12px 15px;
  }
  
  .logo {
    font-size: 20px;
  }

  .logo-img {
    height: 32px;
  }

  .logo-text {
    font-size: 16px;
  }
  
  .nav a {
    padding: 5px 10px;
    font-size: 12px;
  }
  
  .container {
    margin: 15px 10px;
    padding: 20px 15px;
  }
  
  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
  
  .hero {
    padding: 30px 20px;
  }
  
  .hero h1 { font-size: 26px; }
  
  /* Таблицы: горизонтальная прокрутка */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  th, td {
    padding: 10px 8px;
    font-size: 12px;
  }
  
  /* Кнопки крупнее для пальцев */
  .btn, .calc-btn {
    padding: 14px 20px;
    font-size: 15px;
  }
  
  .calculation-actions button {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  /* Уменьшаем водяной знак в PDF */
  .pdf-watermark {
    font-size: 80px;
  }
}

/* Очень маленькие экраны (до 360px) */
@media (max-width: 360px) {
  .nav a {
    padding: 4px 8px;
    font-size: 11px;
  }
  
  .container {
    padding: 15px 12px;
  }
  
  h1 { font-size: 20px; }
}

/* Горизонтальная ориентация телефона */
@media (max-height: 500px) and (orientation: landscape) {
  .header {
    position: relative;
  }
  
  .hero {
    margin: 20px 15px;
    padding: 30px 20px;
  }
}

/* Улучшения для сенсорных экранов */
@media (hover: none) and (pointer: coarse) {
  /* Увеличиваем зоны нажатия */
  .nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  button, .btn {
    min-height: 44px;
  }
  
  /* Убираем hover-эффекты на тач-устройствах */
  .calculation-card:hover,
  .summary-card:hover,
  .feature:hover {
    transform: none;
  }
}

/* Печать (на случай если кто-то решит распечатать) */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .header, .action-buttons, .calc-btn {
    display: none !important;
  }
  
  .container {
    box-shadow: none;
    border: none;
    margin: 0;
    padding: 20px;
  }
  
  h1, h2, h3 {
    color: black !important;
  }
}
/* Бейдж заблокированного пользователя в админке */
.blocked-badge { font-size: 12px; color: #ff6b6b; background: rgba(255,107,107,.12); border: 1px solid #ff6b6b; border-radius: 8px; padding: 2px 8px; vertical-align: middle; }
.block-btn { cursor: pointer; border-radius: 8px; padding: 8px 14px; font-weight: 600; }

/* ===== Админ-панель: сворачиваемые секции, период, бейджи поддержки ===== */
.collapsible-head { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; margin-bottom: 15px; }
.collapsible-head h2 { margin: 0; }
.collapse-arrow { color: var(--gold, #d4af37); font-size: 14px; transition: transform .2s ease; }
.collapsed .collapse-arrow { transform: rotate(-90deg); }
.period-btn { padding: 6px 14px; border-radius: 8px; border: 1px solid rgba(212,175,55,.35); background: transparent; color: inherit; opacity: .8; cursor: pointer; font-weight: 600; font-size: 13px; }
.period-btn.active { background: linear-gradient(135deg, #d4af37, #b8952e); color: #0a0e27; border-color: #d4af37; opacity: 1; }
.badge-new { display: inline-block; background: rgba(212,175,55,.15); color: #d4af37; border: 1px solid rgba(212,175,55,.4); border-radius: 10px; font-size: 11px; padding: 2px 8px; margin-left: 8px; }
.badge-answered { display: inline-block; background: rgba(76,175,80,.12); color: #4caf50; border: 1px solid rgba(76,175,80,.35); border-radius: 10px; font-size: 11px; padding: 2px 8px; margin-left: 8px; }
.q-text { cursor: pointer; }
@media (max-width: 640px) {
  .period-btn { padding: 5px 10px; font-size: 12px; }
}

/* ===== 💭 Карусель мыслей участников (index.html) ===== */
.thoughts-section {
  background: linear-gradient(160deg, #0a0e27 0%, #1a1f3a 100%);
  padding: 60px 20px;
}
body.light .thoughts-section {
  background: linear-gradient(160deg, #f5f7fb 0%, #e8ecf5 100%);
}
.thoughts-section .container { max-width: 900px; margin: 0 auto; }
.section-title { text-align: center; color: var(--gold); font-size: 28px; margin-bottom: 8px; }
.section-subtitle { text-align: center; color: rgba(244, 229, 194, 0.7); margin-bottom: 36px; font-size: 16px; }
body.light .section-subtitle { color: rgba(30, 41, 82, 0.7); }

.thoughts-carousel {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 12px;
  outline: none;
}
.thoughts-carousel:focus-visible { box-shadow: 0 0 0 2px var(--gold); border-radius: 16px; }

.thoughts-track { flex: 1; min-height: 220px; display: flex; }
.thought-card {
  flex: 1;
  position: relative;
  background: rgba(26, 31, 58, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 16px;
  padding: 40px 48px 28px;
  transition: opacity 0.3s ease-in-out;
}
body.light .thought-card { background: rgba(255, 255, 255, 0.7); }
.thought-card.fading { opacity: 0; }

.thought-quote {
  position: absolute;
  top: 2px;
  left: 20px;
  font-size: 72px;
  line-height: 1;
  color: #d4af37;
  opacity: 0.45;
  font-family: Georgia, serif;
  pointer-events: none;
}
.thought-text {
  color: #f4e5c2;
  font-size: 19px;
  font-style: italic;
  line-height: 1.6;
  margin: 0 0 18px;
}
body.light .thought-text { color: #2b2f45; }
.thought-author {
  color: #d4af37;
  font-size: 14px;
  text-align: right;
  margin: 0;
  font-weight: 600;
}

.carousel-arrow {
  align-self: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold);
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s, background 0.2s;
  flex-shrink: 0;
}
.thoughts-carousel:hover .carousel-arrow,
.thoughts-carousel:focus-within .carousel-arrow { opacity: 0.85; }
.carousel-arrow:hover { background: rgba(212, 175, 55, 0.25); opacity: 1 !important; }

.carousel-dots { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(160, 160, 170, 0.5);
  cursor: pointer;
  transition: all 0.3s;
}
.carousel-dot.active { background: #d4af37; width: 12px; height: 12px; }
.carousel-dot:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.carousel-controls { display: flex; justify-content: center; margin-top: 14px; }
.carousel-pause {
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold);
  border-radius: 20px;
  padding: 5px 18px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.carousel-pause:hover { background: rgba(212, 175, 55, 0.15); }

.hero-cta { text-align: center; padding: 50px 20px 70px; }
.hero-cta h2 { color: var(--gold); font-size: 26px; margin-bottom: 10px; }
.hero-cta p { color: rgba(244, 229, 194, 0.8); margin-bottom: 24px; }
body.light .hero-cta p { color: rgba(30, 41, 82, 0.8); }

@media (max-width: 1024px) {
  .thought-text { font-size: 17px; }
  .thought-card { padding: 36px 40px 24px; }
}
@media (max-width: 768px) {
  .thoughts-section { padding: 40px 12px; }
  .thought-text { font-size: 15px; }
  .thought-card { padding: 34px 22px 20px; }
  .thought-quote { font-size: 54px; left: 12px; }
  .section-title { font-size: 22px; }
  .carousel-arrow { position: static; }
  .thoughts-carousel { flex-direction: column-reverse; }
  .thoughts-carousel .carousel-arrow { display: none; }
  .carousel-arrows-mobile { display: flex; }
  .carousel-dot { width: 6px; height: 6px; }
  .carousel-dot.active { width: 10px; height: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .thought-card, .carousel-dot, .carousel-arrow { transition: none; }
}

/* ============================================
   БЛОК МЫСЛИ УЧАСТНИКОВ (ВВЕРХУ СТРАНИЦЫ)
   ============================================ */

.thoughts-banner {
  background: linear-gradient(135deg, #0a0e27 0%, #151a3a 100%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

.thoughts-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.thoughts-container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.thoughts-quote-mark {
  position: absolute;
  top: -20px;
  left: 10px;
  font-size: 120px;
  color: #d4af37;
  opacity: 0.15;
  font-family: Georgia, serif;
  line-height: 1;
  pointer-events: none;
  z-index: 0;
}

.thoughts-carousel {
  position: relative;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 60px;
}

.thoughts-content {
  text-align: center;
  transition: opacity 0.6s ease, transform 0.6s ease;
  opacity: 1;
  transform: translateY(0);
  z-index: 1;
  position: relative;
}

.thoughts-content.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

.thoughts-text {
  font-size: 22px;
  line-height: 1.6;
  color: #f4e5c2;
  font-style: italic;
  margin: 0 auto 20px auto;
  max-width: 750px;
  font-family: Georgia, 'Times New Roman', serif;
}

.thoughts-author {
  font-size: 16px;
  color: #d4af37;
  font-weight: 600;
  margin: 0 auto;
  text-align: right;
  max-width: 750px;
}

.thoughts-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: #d4af37;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.3s ease;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.thoughts-carousel:hover .thoughts-arrow { opacity: 1; }
.thoughts-arrow:hover { background: rgba(212, 175, 55, 0.25); }
.thoughts-arrow--prev { left: 10px; }
.thoughts-arrow--next { right: 10px; }

.thoughts-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.thoughts-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
}

.thoughts-dot.active {
  width: 10px;
  height: 10px;
  background: #d4af37;
}

.thoughts-dot:hover { background: rgba(212, 175, 55, 0.6); }

@media (max-width: 768px) {
  .thoughts-banner { padding: 30px 15px; }
  .thoughts-carousel { padding: 15px 40px; min-height: 180px; }
  .thoughts-text { font-size: 17px; line-height: 1.5; }
  .thoughts-author { font-size: 14px; }
  .thoughts-quote-mark { font-size: 80px; top: -10px; }
  .thoughts-arrow { opacity: 0.7; width: 32px; height: 32px; font-size: 20px; }
  .thoughts-arrow--prev { left: 5px; }
  .thoughts-arrow--next { right: 5px; }
}

@media (max-width: 480px) {
  .thoughts-text { font-size: 15px; }
  .thoughts-carousel { padding: 10px 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .thoughts-content { transition: none; }
  .thoughts-arrow, .thoughts-dot { transition: none; }
}
