/* 
  Цветовые переменные — удобно менять всю тему в одном месте 
*/
:root {
  --bg: #0e0e12;                   /* цвет фона */
  --text: #e9e9ee;                 /* основной цвет текста */
  --muted: #a2a2b5;                /* второстепенный текст */
  --accent: #ffcc00;               /* акцентный цвет (Web3.0) */
  --card: rgba(255,255,255,0.04);  /* фон карточек в админке и формах */
  --shadow: 0 10px 30px rgba(0,0,0,0.4); /* универсальная тень */
}

/* 
  Сброс коробочной модели для всех элементов 
*/
* { 
  box-sizing: border-box; 
}

/* 
  Базовые стили для html и body 
*/
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 
  Canvas для анимации крипто-иконок на фоне 
*/
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: radial-gradient(1200px 600px at 70% 20%, rgba(255,255,255,0.05), transparent 60%);
}

/* 
  Основной блок hero (главный экран) 
*/
.hero {
  position: relative;
  z-index: 1;             /* выше фона */
  min-height: 100dvh;     /* занимает всю высоту экрана */
  display: grid;
  place-items: center;    /* выравнивание по центру и по вертикали и по горизонтали */
  padding: 24px;
}

/* 
  Контейнер внутри hero 
*/
.hero__inner {
  max-width: 880px;
  width: 100%;
  text-align: center;     /* выравнивание всего контента по центру */
  margin: 0 auto;
}

/* 
  Заголовок "Добро пожаловать в Web3.0" 
*/
.hero__title {
  margin: 0 0 14px;
  line-height: 1.05;
  font-weight: 800;
  font-size: clamp(36px, 7vw, 64px); /* гибкий размер от мобилы до десктопа */
  letter-spacing: -0.02em;
}

/* 
  Жёлтый акцент в слове Web3.0 
*/
.accent { 
  color: var(--accent); 
}

/* 
  Подзаголовок (текст с условиями) 
*/
.hero__sub {
  margin: 0 auto 28px;
  color: var(--muted);
  max-width: 560px;                     /* ограничение ширины для читаемости */
  font-size: clamp(14px, 2.8vw, 16px);  /* адаптивный размер */
}

/* 
  Ссылки внутри подзаголовка 
*/
.hero__sub a { 
  color: #c6c6ff; 
  text-decoration: underline; 
  text-underline-offset: 2px; 
}

/* 
  Блок с кнопкой и ссылкой "Войти" 
*/
.hero__actions { 
  display: flex; 
  flex-direction: column; 
  align-items: center;  /* центрируем элементы по горизонтали */
  gap: 12px;            /* расстояние между кнопкой и текстом */
}

/* 
  Универсальный стиль кнопок 
*/
.btn {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: transform .15s ease, filter .2s ease;
  border: none !important;   /* Убираем обводку */
  outline: none !important;  /* Убираем контур */
  background: none;          /* сброс фоновой заливки по умолчанию */
  cursor: pointer;
}

/* 
  Жёлтая кнопка "Зарегистрироваться" 
*/
.btn--primary { 
  background: var(--accent); 
  color: #222; 
  border: none !important;   /* чтобы точно не было обводки */
}

.btn--primary:hover { 
  transform: translateY(-1px); 
  filter: brightness(1.05); 
}

/* 
  Подпись "Уже есть аккаунт? Войти в систему" 
*/
.login-hint { 
  color: var(--muted); 
  font-size: 14px; 
}
.login-hint a { 
  color: #fff; 
}

/* 
  Адаптив для больших экранов 
*/
@media (min-width: 1200px) {
  .hero__title { font-size: 72px; }
}

/***** регистрация *****/
/* Общий контейнер для страниц авторизации (регистрация/логин) */
.auth {
  min-height: 100dvh;              /* во всю высоту экрана */
  display: flex;
  align-items: center;             /* по вертикали центр */
  justify-content: center;         /* по горизонтали центр */
  padding: 16px;
}

/* Карточка формы (регистрация / вход) */
.card--auth {
  width: 100%;
  max-width: 420px;                /* ширина карточки */
  background: rgba(15, 15, 20, 0.85); /* прозрачный фон */
  backdrop-filter: blur(8px);         /* эффект стекла */
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  padding: 28px;
}

.card__title {
  margin: 0 0 22px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
}

/* Поля ввода */
.field__input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 8px;
  border: none;
  outline: none;
  background: #1a1a24;
  color: #fff;
  font-size: 15px;
}

/* Кнопка на всю ширину */
.btn--block {
  width: 100%;
}

/* Подсказка под кнопкой */
.auth__hint {
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.auth__hint a {
  color: var(--accent);
  font-weight: 600;
}
/*******************/

/* ======= TOPBAR (мобилка) + DRAWER ======= */
.app{ position:relative; z-index:2; min-height:100dvh; }

.topbar{
  position: sticky; top:0; z-index:4;
  display: flex; align-items: center; gap:12px;
  padding: 10px 14px;
  background: rgba(10,10,14,0.92);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.topbar__title{ margin: 0 auto; font-weight: 700; }

.icon-btn{
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  border-radius: 10px; border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
}
.icon-btn span{ width:18px; height:2px; background:#e9e9ee; position:relative; display:block; }
.icon-btn span::before, .icon-btn span::after{
  content:""; position:absolute; left:0; width:18px; height:2px; background:#e9e9ee;
}
.icon-btn span::before{ top:-6px; }
.icon-btn span::after{ top:6px; }

.icon-btn--close span{ background: transparent; }
.icon-btn--close span::before{ transform: rotate(45deg); top:0; }
.icon-btn--close span::after{ transform: rotate(-45deg); top:0; }

/* Drawer */
.drawer{
  position: fixed; inset:0 auto 0 0; width: 88vw; max-width: 300px;
  background: rgba(10,10,14,0.98);
  transform: translateX(-100%); transition: transform .25s ease;
  z-index: 5; display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.drawer.open{ transform: translateX(0); }

.scrim{
  position: fixed; inset:0; background: rgba(0,0,0,0.35);
  opacity:0; pointer-events:none; transition: opacity .2s ease; z-index:4;
}
.scrim.show{ opacity:1; pointer-events:auto; }

.drawer__header{
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.drawer__brand{ color: var(--accent); font-weight:800; font-size:20px; }
.drawer__nav, .drawer__footer{ display:grid; gap:6px; padding: 10px; }
.drawer__footer{ border-top: 1px solid rgba(255,255,255,0.06); margin-top:auto; }
.drawer__link{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:10px; color:#d6d6df; text-decoration:none;
}
.drawer__link:hover{ background: rgba(255,255,255,0.06); }

/* ======= DESKTOP LAYOUT ======= */
.layout{
  display:grid; grid-template-columns: 260px 1fr; min-height: calc(100dvh - 56px);
}

/* Sidebar (виден на >=992px) */
.sidebar{
  display:none;
  background: rgba(10,10,14,0.92);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-right: 1px solid rgba(255,255,255,0.06);
  padding: 16px 14px;
}
.sidebar__brand{ color: var(--accent); font-weight: 800; font-size: 20px; margin-bottom: 12px; }
.sidebar__nav{ display:grid; gap:6px; margin-bottom:18px; }
.sidebar__link{
  display:flex; align-items:center; gap:10px; padding:10px 12px;
  border-radius:10px; color:#d6d6df; text-decoration:none;
}
.sidebar__link:hover{ background: rgba(255,255,255,0.06); }
.sidebar__footer{ border-top: 1px solid rgba(255,255,255,0.06); padding-top: 10px; }

/* Контент */
.dash{ padding: 18px; }
.dash__title{ margin: 0 0 16px; font-weight:800; font-size: clamp(22px,3.6vw,34px); }

/* Карточки-метрики */
.cards{
  display:grid; gap:14px; margin-bottom:18px;
  grid-template-columns: repeat(3,minmax(0,1fr));
}
.card-mini{
  background: rgba(20,20,26,0.9);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; padding: 14px;
}
.card-mini__title{ color: var(--muted); font-size:13px; margin-bottom:6px; }
.card-mini__value{ color: var(--accent); font-weight: 800; font-size: 20px; }

/* Панель */
.panel{
  background: rgba(20,20,26,0.9);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; padding: 16px;
}
.panel__title{ margin:0 0 10px; font-size:18px; }
.panel__empty{ color: var(--muted); }

/* Список стратегий */
.list{ list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.list__item{
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
  padding:12px; border-radius:10px;
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04);
}
.list__title{ font-weight:700; }
.list__desc{ color:var(--muted); font-size:14px; margin-top:3px; }
.list__actions{ display:flex; gap:8px; flex-wrap:wrap; }

/* ======= BREAKPOINTS ======= */
@media (min-width: 992px){
  .topbar{ display:none; }          /* десктоп — без топбара */
  .sidebar{ display:block; }        /* десктоп — показываем левый сайдбар */
}

@media (max-width: 991.98px){
  .layout{ grid-template-columns: 1fr; }      /* контент на всю ширину */
  .cards{ grid-template-columns: 1fr; }       /* карточки в столбик */
  .list__item{ flex-direction: column; }      /* кнопки под описанием */
}

/* Активный пункт меню — жёлтый фон/чёрный текст */
.sidebar__link.is-active,
.drawer__link.is-active{
  background: var(--accent);
  color: #111 !important;
  font-weight: 700;
}
.sidebar__link.is-active svg,
.drawer__link.is-active svg{
  color: #111;
}

/* Базовый цвет иконок в навигации */
.sidebar__link svg,
.drawer__link svg{ color:#d6d6df; }

/* Ховеры */
.sidebar__link:hover:not(.is-active),
.drawer__link:hover:not(.is-active){
  background: rgba(255,255,255,0.06);
}
/**********************/

/* ===== Settings card (центрированная форма как на макете) ===== */
.card--settings{
  max-width: 560px;
  margin: 0 auto;            /* по центру контента */
  background: rgba(20,20,26,0.92);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 18px 16px 16px;
}
.card--settings .card__title{
  margin: 4px 0 14px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

.form--settings .field{ display:grid; gap:6px; margin-bottom:12px; }
.field__label{ font-size:13px; color: var(--muted); }
.field__input{
  display:block; width:100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: #1a1a24;
  color: #e9e9ee;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field__input:focus{
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.field__input[readonly]{
  opacity: .9;
  cursor: default;
}

.note{ font-size:14px; text-align:center; margin: 0 0 10px; }
.note.success{ color:#69db7c; }
.note.error{ color:#ff6b6b; }

@media (max-width: 991.98px){
  .card--settings{ max-width: 92vw; }
}

/*байбит анимация*/
/* =========================
   TYPEWRITER (HERO) PATCH
   ========================= */

/* печать строк заголовка */
.hero__title--type .type-line{
  display: inline-block;
  white-space: pre;
  min-height: 1em;
}

/* каретка */
.type-caret{
  display: inline-block;
  width: 0.08em;
  height: 0.95em;
  margin-left: 0.08em;
  background: rgba(255,255,255,.85);
  vertical-align: -0.05em;
  animation: caretBlink 900ms steps(1,end) infinite;
}

@keyframes caretBlink{
  50%{ opacity: 0; }
}

/* третья строка (в Bybit Web3) скрыта до момента показа */
.hero-third{
  display: inline-flex;
  align-items: baseline;
  gap: 0.14em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .45s ease, transform .45s ease;
}

.hero-third.is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* показать кнопки/хинт после печати */
[data-type-show]{
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .35s ease, transform .35s ease;
}

[data-type-show].is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* печать описания */
.hero__sub--type .type-paragraph{
  display: inline;
  white-space: pre-wrap;
}

/* ссылки скрываем, показываем по очереди */
[data-type-link]{
  opacity: 0;
  transition: opacity .25s ease;
}

[data-type-link].is-visible{
  opacity: 1;
}

/* =========================
   BYBIT WORDMARK STYLE
   ========================= */

.bybitapi{
  display: inline-flex;
  align-items: baseline;
  gap: 0.02em;
  margin-left: 0.18em;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  transform: translateY(0.03em);
}

.bybitapi > span{
  display: inline-block;
  line-height: 1;
}

.bybitapi > span.gap{
  width: 0.28em;
  opacity: 1 !important;
  transform: none !important;
}

/* =========================
   BYBIT TYPE ANIMATION
   ========================= */

.hero-third .bybitapi > span:not(.gap){
  opacity: 0;
  transform: translateY(0.18em);
  transition: opacity .35s ease, transform .35s ease;
}

.hero-third .bybitapi > span.is-on{
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   ACCESSIBILITY
   ========================= */

@media (prefers-reduced-motion: reduce){
  .type-caret{ animation: none !important; }

  .hero-third,
  [data-type-show]{
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  [data-type-link]{
    opacity: 1 !important;
    transition: none !important;
  }

  .hero-third .bybitapi > span:not(.gap){
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
