@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

/* === Цветовые переменные === */
:root {
  /* Светлая тема */
  --bg-gradient-light: linear-gradient(180deg, #0f4c81 0%, #00c2c2 100%);
  --card-bg-light: rgba(255, 255, 255, 0.12);
  --text-light: #ffffff;
  --button-gradient-light: linear-gradient(135deg, #0094ff, #00e0c6);
  --btn-grad: linear-gradient(135deg,#0c3f66 0%, #0a6a6a 100%);   /* основной тёмный */
  --btn-grad-hover: linear-gradient(135deg,#0e4a79 0%, #0b7676 100%);
  --btn-grad-active: linear-gradient(135deg,#0a2f4e 0%, #095c5c 100%);
  /* Тёмная тема */
  --bg-gradient-dark: linear-gradient(180deg, #0a243a 0%, #006666 100%);
  --card-bg-dark: rgba(0, 0, 0, 0.3);
  --text-dark: #e8f0ff;
  --button-gradient-dark: linear-gradient(135deg, #365c85, #2c5f5f);
}

/* === Базовая стилизация === */
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Poppins", sans-serif;
  color: var(--text-light);
  background: var(--bg-gradient-light);
  background-attachment: fixed;
  overflow: hidden;
  transition: background 0.5s ease, color 0.5s ease;
}

/* === Контейнер === */
.app-container {
  width: 90%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  animation: fadeIn 0.8s ease-out;
}

/* === Логотип === */
.logo {
  margin-top: -70px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.logo img {
  width: 160px;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.3));
  animation: float 3s ease-in-out infinite;
}

/* === Карточки === */
.card {
  width: 90%;
  background: var(--card-bg-light);
  backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 26px 22px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: background 0.5s ease, box-shadow 0.3s ease;
}

h1, h2 {
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
h1 { font-size: 30px; }
h2 { font-size: 26px; }

.info {
  margin: 18px 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  line-height: 1.5;
}

/* === Кнопки === */
button{
  width:100%;
  padding:15px;
  margin:10px 0;
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  font-size:15px;
  font-weight:600;
  color:#ffffff;
  background: var(--btn-grad);                 /* было: var(--button-gradient-light) */
  cursor:pointer;
  box-shadow: 0 8px 18px rgba(10,60,90,.35);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  display:flex; justify-content:center; align-items:center; gap:6px;
}
button:hover{
  background: var(--btn-grad-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(10,60,90,.45);
}
button:active{
  background: var(--btn-grad-active);
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(0,0,0,.35);
}
button:disabled{ opacity:.65; filter:saturate(.8); cursor:not-allowed; }
.btn-locked {
  opacity: .55;
  cursor: default;
  filter: saturate(.7);
  transform: none !important;
  box-shadow: 0 4px 10px rgba(0,0,0,.25);
}
.btn-locked:hover { filter: saturate(.7) brightness(1); }
.btn-locked {
  opacity: .55;
  cursor: default;
  filter: saturate(.7);
  transform: none !important;
}
.btn-locked:hover { filter: saturate(.7) brightness(1); }

/* === Сетка кнопок === */
.grid-buttons { display: flex; gap: 10px; margin: -10px 0;}
.grid-buttons button { flex: 1; }

/* === Транзакции === */
.transaction {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 15px;
  color: var(--text-light);
}

.link { color: #ffffff; text-decoration: underline; cursor: pointer; }

/* === Анимации === */
@keyframes fadeIn { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }

/* === Тёмная тема === */
body.dark-mode { background: var(--bg-gradient-dark); color: var(--text-dark); }
body.dark-mode .card { background: var(--card-bg-dark); box-shadow: 0 6px 16px rgba(0,0,0,0.6); }
body.dark-mode .transaction { background: rgba(255,255,255,0.08); color: var(--text-dark); }
body.dark-mode button { background: var(--button-gradient-dark); }
body.dark-mode .link { color: #00e0ff; }

/* === setup.html (актуальная версия) === */
.setup-body {
  background: var(--bg-gradient-light);
  color: var(--text-light);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}
body.dark-mode.setup-body { background: var(--bg-gradient-dark); color: var(--text-dark); }

.loader { color: #aaa; text-align: center; padding: 40px; font-size: 16px; }

.setup-container {
  width: 90%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.08) 100%);
  backdrop-filter: blur(14px);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 90vh;
  overflow: hidden;
}
body.dark-mode .setup-container {
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.25) 100%);
}

.setup-header { text-align: center; margin-bottom: 10px; }
.setup-header img {
  width: 60px; height: auto; margin-bottom: 6px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
.setup-header h2 { font-size: 17px; margin: 0; color: var(--text-light); }
body.dark-mode .setup-header h2 { color: var(--text-dark); }

/* === Прокручиваемый контент === */
.setup-scroll {
  flex: 1; width: 100%;
  overflow-y: auto;
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.1);
}
body.dark-mode .setup-scroll { background: rgba(255,255,255,0.08); }
.setup-scroll::-webkit-scrollbar { width: 6px; }
.setup-scroll::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,0.4); border-radius: 3px; }

/* === Ссылки === */
.setup-scroll a { color: #00e0ff; text-decoration: underline; }

/* === Подвал === */
.setup-footer { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }

#support-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 10px rgba(0,0,0,0.25); }
.back-btn {
  width: 100%;
  background: linear-gradient(135deg, #0078d7, #00bfff);
  color: #fff; border: none; border-radius: 10px;
  padding: 12px; font-size: 15px; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s;
}
.back-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 10px rgba(0,0,0,0.25); }

/* === profile.html === */
.config-block {
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  margin-bottom: 16px;
}
.config-block label {
  font-size: 14px; font-weight: 600; color: var(--text-light);
  display: flex; margin-bottom: 6px; gap: 5px;
}
.config-input {
  display: flex; align-items: center;
  background: rgba(0,0,0,0.2);
  border-radius: 8px; overflow: hidden; padding-right: 5%;
}
.config-input input {
  flex: 1; background: transparent; border: none; outline: none;
  padding: 10px; font-size: 14px; color: var(--text-light);
}
.config-input button {
  background: linear-gradient(135deg, #0078d7, #00bfff);
  color: #fff; padding: 8px 10px; cursor: pointer; font-size: 14px; width: 15%;
}
.config-block small { display: block; text-align: center; opacity: 0.8; margin-top: 4px; font-size: 12px; }

/* Кнопки профиля */
.profile-buttons button {
  width: 100%; margin-top: 10px;
  background: linear-gradient(135deg, #0094ff, #00e0c6);
  border-radius: 10px; color: #fff; padding: 12px; font-size: 15px; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s;
}
.profile-buttons button:hover { transform: translateY(-2px); box-shadow: 0 5px 10px rgba(0,0,0,0.25); }
body.dark-mode .config-block { background: rgba(255,255,255,0.08); }
body.dark-mode .config-input { background: rgba(255,255,255,0.1); }

/* === Popup окно подписки === */
.popup {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.popup.active { opacity: 1; pointer-events: all; }
.popup-content {
  background: linear-gradient(180deg, #0d2538 0%, #09202f 100%);
  color: #fff; border-radius: 16px; padding: 24px 20px;
  width: 88%; max-width: 360px; text-align: center;
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.25);
  font-family: "Poppins", sans-serif;
  transform: scale(0.9); transition: transform 0.25s ease;
}
.popup.active .popup-content { transform: scale(1); }
.popup-content h3 { color: #00e0ff; margin-bottom: 10px; font-size: 18px; }
.popup-content p { font-size: 14px; color: #cde4ff; margin-bottom: 10px; line-height: 1.4em; }
.popup-content input {
  margin-top: 10px; padding: 10px; width: 95%;
  background: rgba(0, 0, 0, 0.3); color: #00e0ff;
  border: 1px solid #00e0ff; border-radius: 8px; font-size: 13px; text-align: center;
}
.popup-buttons { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.popup-buttons button {
  border: none; border-radius: 10px; font-size: 15px; font-weight: 600;
  padding: 12px; cursor: pointer; transition: 0.2s;
}
.popup-buttons .copy-btn { background: linear-gradient(135deg, #00e0ff, #00bfff); color: #001220; }
.popup-buttons .close-btn { background: linear-gradient(135deg, #333, #222); color: #fff; }
.popup-buttons button:hover { opacity: 0.9; }

/* === Cards of installation wizard === */
.page-card {
  padding: 26px 22px 24px;
  overflow: hidden; /* логотип не выходит за карточку */
}

/* крупный «герой»-логотип внутри карточки */
.hero-logo {
  width: 100%;
  display: flex; justify-content: center; align-items: center;
  margin: 6px 0 14px;
}
.hero-logo img {
  width: clamp(140px, 58%, 260px);
  height: auto;
  max-width: 80%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.25));
}

/* единый зазор между кнопками на страницах мастера */
.page-card .btn-group > button + button { margin-top: 10px; }

/* утилита */
.mb-2 { margin-bottom: 10px; }

@media (max-width: 380px) {
  .hero-logo img { width: clamp(130px, 54%, 220px); }
}

/* прокручиваемая карточка для длинных инструкций */
.page-card--scroll {
  display: flex; flex-direction: column;
  max-height: calc(100vh - 8vh);
}
.content-scroll,
.content-scroll--lg {
  flex: 1 1 auto;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  max-height: 400px;
  border-radius: 15px;
}
@media (max-height: 720px) {
  .content-scroll, .content-scroll--lg { max-height: calc(100vh - 200px); }
}

/* тёмная тема для скролльного блока */
body.dark-mode .content-scroll--lg { background: rgba(255, 255, 255, 0.08); padding: 10px;}

/* аккуратный скроллбар */
.content-scroll--lg::-webkit-scrollbar { width: 6px; }
.content-scroll--lg::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.35); border-radius: 3px; }

/* типографика внутри инструкции */
.content-scroll--lg h3 { margin: 8px 0 6px; font-size: 18px; text-align: left; }
.content-scroll--lg ol,
.content-scroll--lg ul { text-align: left; padding-left: 20px; margin: 0 0 14px; }

@media (max-height: 700px) {
  .page-card--scroll { max-height: 92vh; }
  .content-scroll--lg { padding: 14px; }
}

/* FIX: лого внутри карточек мастера не мешает кликам */
.page-card .logo,
.page-card .hero-logo { margin-top: 0 !important; pointer-events: none; }
.page-card .hero-logo img { pointer-events: none; user-select: none; }
.page-card .btn-group { position: relative; z-index: 2; }

.card .logo {
  margin-top: 0 !important;
  pointer-events: none;    /* пропускаем тапы к кнопкам ниже */
}
.card .logo img {
  pointer-events: none;
  user-select: none;
}
.card .hero-logo {
  margin-top: 0 !important;
  pointer-events: none;
}
.card .hero-logo img {
  pointer-events: none;
  user-select: none;
}

/* Кнопки всегда поверх любых декоративных слоёв */
.card .btn-group {
  position: relative;
  z-index: 2;
}

/* Ссылки-кнопки выглядят как настоящие кнопки */
a.btn, a.btn-outline {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  margin: 10px 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: all 0.25s ease;

}

a.btn { background: var(--button-gradient-light); color: #fff; gap: 5px;}
a.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.3); filter: brightness(1.05); }

body.dark-mode a.btn { background: var(--button-gradient-dark); color: var(--text-dark); }

#transactions-list{
  max-height: 60vh;          /* подгони под себя: 55–70vh */
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch; /* плавный скролл на iOS */
}

/* аккуратный скроллбар (не мешает, опционально) */
#transactions-list::-webkit-scrollbar{ width: 6px; }
#transactions-list::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.35);
  border-radius: 3px;
}

/* Компактная сетка тарифов */
.plans-grid{
  display:grid; gap:14px; margin:14px 0 8px;
  grid-template-columns:1fr;
}
@media (min-width:420px){ .plans-grid{ grid-template-columns:1fr 1fr; } }

.plan-card{
  background: linear-gradient(135deg,#0d3a4b,#0a6fa1);
  border-radius:16px; padding:14px; color:#fff;
  box-shadow:0 10px 24px rgba(0,0,0,.18);
  position:relative; display:flex; flex-direction:column; gap:10px;
}
.plan-card.hot{ outline:2px solid rgba(255,255,255,.15); }
.plan-card.best{ background: linear-gradient(135deg,#0e4458,#0996b8); }

.plan-card .ribbon{
  background:rgba(255,255,255,.16); backdrop-filter: blur(6px);
  border-radius:999px; padding:4px 10px; font-size:12px; font-weight:600;
}
.plan-card h3{ margin:0; font-size:16px; letter-spacing:.2px; }
.plan-card .price{ display:flex; gap:8px; align-items:baseline; }
.plan-card .price b{ font-size:20px; }
.plan-card .price span{ font-size:12px; opacity:.85; }

.plan-card .features{
  margin:0; padding-left:16px; display:grid; gap:4px; font-size:13px; opacity:.95;
}
.plan-card .subscribe-btn{
  margin-top:auto; min-height:40px; border-radius:10px;
  font-size:14px; font-weight:600;
  background: linear-gradient(90deg,#486587,#2c5f5f);
  color:#fff; border:none; cursor:pointer;
}
.btn.small{ min-height:38px; font-size:13px; border-radius:10px; }

.plan-cta{
  width:auto;
  padding:10px 14px;
  font-size:14px;
  border-radius:10px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  box-shadow:none;
}
.plan-cta:hover{ background: rgba(255,255,255,.12); }

.btn-ghost{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.14);
  box-shadow:none;
}
.btn-ghost:hover{ background: rgba(255,255,255,.12); }