/* ====== CSS ПЕРЕМЕННЫЕ ====== */
:root {
  --bg: #0b0c10;
  --panel: #11131a;
  --text: #e7e9ee;
  --muted: #9aa3b2;
  --brand: #6ea8fe;
  --brand-2: #8bd3ff;
  --accent: #a78bfa;
}

/* ====== ШАПКА (контраст ссылок в меню) ====== */
.nav{background:#0b0d10;color:#fff}
.nav .menu a{
  color:#e5e7eb; background:transparent; border:none;
  padding:8px 10px; border-radius:8px; text-decoration:none
}
.nav .menu a:hover{color:#fff; background:rgba(255,255,255,.06)}
.nav .btn-primary{background:#fff;color:#111;border-color:#fff}
.nav .btn-primary:hover{background:#f5f5f5}

/* ====== БАЗА ====== */
.auth-slot{margin-left:auto;display:flex;gap:8px;align-items:center}
.chip{
  padding:10px 16px;
  border-radius:999px;
  background:rgba(110,168,254,0.1);
  border:1px solid rgba(110,168,254,0.2);
  color:var(--text);
  text-decoration:none;
  font-size:0.9rem;
  font-weight:500;
  transition:all 0.3s ease;
}
.chip:hover{
  background:rgba(110,168,254,0.15);
  border-color:var(--brand);
  transform:translateY(-1px);
}

/* Стили для кнопки "Выйти" в шапке */
.auth-slot .btn-secondary {
  background: rgba(110,168,254,0.1) !important;
  border: 1px solid rgba(110,168,254,0.2) !important;
  color: var(--text) !important;
}
.auth-slot .btn-secondary:hover {
  background: rgba(110,168,254,0.15) !important;
  border-color: var(--brand) !important;
  color: var(--text) !important;
}
.btn{
  border:1px solid transparent;
  border-radius:12px;
  padding:12px 20px;
  background:transparent;
  cursor:pointer;
  transition:all 0.3s ease;
  font-weight:600;
  font-size:0.95rem;
}
.btn:hover{
  transform:translateY(-1px);
}
.btn-primary{
  background:linear-gradient(135deg,var(--brand),var(--accent));
  color:#fff;
  border-color:transparent;
  box-shadow:0 4px 12px rgba(110,168,254,0.3);
}
.btn-primary:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 20px rgba(110,168,254,0.4);
}
.btn-ghost{
  background:transparent;
  border-color:transparent;
  color:var(--muted);
}
.btn-ghost:hover{
  color:var(--text);
  background:rgba(110,168,254,0.1);
}
/* Стили для кнопок только в модалке */
.modal .btn-secondary{
  background:rgba(255,255,255,0.2) !important;
  border:1px solid rgba(255,255,255,0.4) !important;
  color:#ffffff !important;
  font-weight:600;
}
.modal .btn-secondary:hover{
  background:rgba(255,255,255,0.3) !important;
  border-color:rgba(255,255,255,0.5) !important;
  transform:translateY(-1px);
  color:#ffffff !important;
}

/* Дополнительные стили для кнопки "Отмена" */
.modal .actions .btn-secondary {
  background: rgba(255,255,255,0.2) !important;
  border: 1px solid rgba(255,255,255,0.4) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

.modal .actions .btn-secondary:hover {
  background: rgba(255,255,255,0.3) !important;
  border-color: rgba(255,255,255,0.5) !important;
  color: #ffffff !important;
}

/* Максимально специфичные стили для кнопки "Отмена" */
.modal .actions button.btn-secondary,
.modal .actions .btn.btn-secondary {
  background: rgba(255,255,255,0.2) !important;
  border: 1px solid rgba(255,255,255,0.4) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

.modal .actions button.btn-secondary:hover,
.modal .actions .btn.btn-secondary:hover {
  background: rgba(255,255,255,0.3) !important;
  border-color: rgba(255,255,255,0.5) !important;
  color: #ffffff !important;
}

/* Стили для всех кнопок в модалке */
.modal .actions .btn {
  background: rgba(255,255,255,0.2) !important;
  border: 1px solid rgba(255,255,255,0.4) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

.modal .actions .btn:hover {
  background: rgba(255,255,255,0.3) !important;
  border-color: rgba(255,255,255,0.5) !important;
  color: #ffffff !important;
}

/* ====== МОДАЛКА ====== */
.modal-backdrop{
  position:fixed;inset:0;
  background:rgba(11,12,16,0.8);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:50;
  backdrop-filter:blur(12px) saturate(120%);
}
.modal{
  width:min(420px,90vw);
  background:#11131a !important;
  border:1px solid rgba(110,168,254,0.2);
  border-radius:16px;
  box-shadow:0 20px 60px rgba(0,0,0,0.4);
  transform:translateY(20px);
  opacity:0;
  transition:.3s ease;
  position:relative;
  overflow:hidden;
}
.modal::before{
  content:'';
  position:absolute;
  top:0;left:0;right:0;bottom:0;
  background:linear-gradient(135deg,rgba(110,168,254,0.05),rgba(167,139,250,0.05));
  z-index:-1;
}
.modal.show{
  transform:translateY(0);
  opacity:1;
  animation:modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn{
  from{
    transform:translateY(30px);
    opacity:0;
  }
  to{
    transform:translateY(0);
    opacity:1;
  }
}
.modal-header{
  display:flex;
  gap:12px;
  padding:16px 20px;
  border-bottom:1px solid rgba(110,168,254,0.1);
  align-items:center;
  background:#11131a !important;
}
.modal-body{
  padding:20px;
  background:#11131a !important;
}
.tabs{display:flex;gap:8px}
.tab{
  padding:8px 14px;
  border-radius:10px;
  cursor:pointer;
  color:#ffffff;
  font-weight:500;
  transition:all 0.3s ease;
  border:1px solid transparent;
  font-size:0.9rem;
}
.tab:hover{
  color:#ffffff;
  background:rgba(110,168,254,0.15);
}
.tab.active{
  background:linear-gradient(135deg,var(--brand),var(--accent));
  color:#fff;
  border-color:transparent;
  box-shadow:0 4px 12px rgba(110,168,254,0.3);
}

/* ====== КНОПКА ЗАКРЫТИЯ ====== */
.close-btn{
  margin-left:auto;
  width:32px;
  height:32px;
  border-radius:8px;
  background:rgba(110,168,254,0.1);
  border:1px solid rgba(110,168,254,0.2);
  color:var(--muted);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:all 0.3s ease;
  font-size:16px;
  font-weight:600;
}
.close-btn:hover{
  background:rgba(110,168,254,0.15);
  color:var(--text);
  transform:scale(1.05);
}

.form-row{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin:12px 0;
}
.form-row label{
  color:#ffffff;
  font-weight:600;
  font-size:0.9rem;
  margin-bottom:4px;
  display:block;
}
.input{
  padding:12px 14px;
  border:1px solid rgba(110,168,254,0.3);
  border-radius:10px;
  font-size:0.95rem;
  outline:none;
  color:#1a1a1a !important;
  background:#ffffff !important;
  transition:all 0.3s ease;
  backdrop-filter:blur(8px);
}
.input:focus{
  border-color:var(--brand);
  background:#ffffff !important;
  box-shadow:0 0 0 3px rgba(110,168,254,0.2);
  transform:translateY(-1px);
  color:#1a1a1a !important;
}
.input:hover{
  border-color:rgba(110,168,254,0.4);
  background:#ffffff !important;
  color:#1a1a1a !important;
}
.input::placeholder{
  color:#666666;
}
/* Принудительно темный цвет только для полей в модалке */
.modal input[type="email"], 
.modal input[type="password"], 
.modal input[type="text"] {
  color: #1a1a1a !important;
  background: #ffffff !important;
}
.modal input[type="email"]:focus, 
.modal input[type="password"]:focus, 
.modal input[type="text"]:focus {
  color: #1a1a1a !important;
  background: #ffffff !important;
}

/* Принудительные стили только для модалки */
.modal .form-row label {
  color: #ffffff !important;
}
.modal .tab {
  color: #ffffff !important;
}
.modal .tab.active {
  color: #ffffff !important;
}
.modal .btn-secondary {
  color: #ffffff !important;
  background: rgba(255,255,255,0.2) !important;
  border: 1px solid rgba(255,255,255,0.4) !important;
}
.hint{
  font-size:0.8rem;
  color:#9aa3b2;
  margin-top:4px;
}

.error{
  color:#ff6b6b;
  font-size:0.85rem;
  opacity:0;
  height:0;
  transition:all 0.3s ease;
  overflow:hidden;
  background:rgba(255,107,107,0.1);
  border:1px solid rgba(255,107,107,0.2);
  border-radius:8px;
  padding:8px 12px;
  margin-top:8px;
}
.error.show{
  opacity:1;
  height:auto;
}
.actions{
  display:flex;
  gap:10px;
  align-items:center;
  margin-top:20px;
  justify-content:flex-end;
}
.actions .btn{
  min-width:100px;
  padding:10px 16px;
  font-size:0.9rem;
}

/* ====== ТОСТЫ ====== */
.toast-wrap{
  position:fixed;
  right:20px;
  bottom:20px;
  display:flex;
  flex-direction:column;
  gap:12px;
  z-index:60;
}
.toast{
  background:var(--panel);
  color:var(--text);
  padding:16px 20px;
  border-radius:16px;
  border:1px solid rgba(110,168,254,0.2);
  box-shadow:0 10px 30px rgba(0,0,0,0.3);
  opacity:0;
  transform:translateY(8px);
  transition:all 0.3s ease;
  backdrop-filter:blur(12px);
}
.toast.show{
  opacity:1;
  transform:translateY(0);
}
.toast.err{
  background:rgba(255,107,107,0.1);
  border-color:rgba(255,107,107,0.3);
  color:#ff6b6b;
}

/* ====== КНОПКИ В СТИЛЕ САЙТА ====== */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:12px 20px;
  border-radius:12px;
  border:1px solid transparent;
  font-weight:600;
  transition:all 0.3s ease;
  cursor:pointer;
  position:relative;
  overflow:hidden;
  font-size:0.95rem;
}
.btn::before{
  content:'';
  position:absolute;
  top:50%;
  left:50%;
  width:0;
  height:0;
  border-radius:50%;
  background:rgba(255,255,255,0.1);
  transform:translate(-50%,-50%);
  transition:width 0.6s,height 0.6s;
}
.btn:hover::before{
  width:300px;
  height:300px;
}
.btn-primary{
  background:linear-gradient(135deg,var(--brand),var(--accent));
  color:#fff;
  border-color:transparent;
  box-shadow:0 4px 12px rgba(110,168,254,0.3);
}
.btn-primary:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 20px rgba(110,168,254,0.4);
}
.btn-secondary{
  background:rgba(110,168,254,0.1);
  color:var(--text);
  border:1px solid rgba(110,168,254,0.2);
}
.btn-secondary:hover{
  background:rgba(110,168,254,0.15);
  border-color:var(--brand);
  transform:translateY(-1px);
}
.btn-ghost{
  background:transparent;
  border-color:transparent;
  color:var(--muted);
}
.btn-ghost:hover{
  color:var(--text);
  background:rgba(110,168,254,0.1);
}

/* ====== ЧЕКБОКС СОГЛАСИЯ ====== */
.consent-checkbox{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin:12px 0;
  padding:12px;
  background:rgba(255,255,255,0.1);
  border:1px solid rgba(255,255,255,0.2);
  border-radius:10px;
  transition:all 0.3s ease;
}
.consent-checkbox:hover{
  background:rgba(255,255,255,0.15);
  border-color:rgba(255,255,255,0.3);
}
.consent-checkbox input[type="checkbox"]{
  width:18px;
  height:18px;
  margin:0;
  accent-color:var(--brand);
  cursor:pointer;
  flex-shrink:0;
  margin-top:2px;
}
.consent-checkbox label{
  color:#ffffff;
  font-size:0.85rem;
  line-height:1.4;
  cursor:pointer;
  margin:0;
}
.consent-checkbox label a{
  color:var(--brand);
  text-decoration:none;
  font-weight:500;
  transition:color 0.3s ease;
}
.consent-checkbox label a:hover{
  color:var(--accent);
  text-decoration:underline;
}

.input{ background:#fff; color:#111; }
.input::placeholder{ color:#9aa3ad; }

/* чип в шапке делаем чуть заметнее на тёмном фоне */
.chip{ background:#1b1e24; border:1px solid #2a2f36; }

/* Контрастная "Отмена" - только для модалки */
.modal .btn-secondary{
  background:#fff;
  color:#111 !important;
  border:1px solid #d0d5dd;
}
.modal .btn-secondary:hover{ background:#f5f6f7; }

/* --- Выравнивание и внешний вид кнопок в футере модалки --- */
.modal .actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;   /* уводим блок кнопок вправо */
  margin-top:16px;
}
.modal .actions .btn{ min-width:120px; }

/* порядок: Отмена слева, основная справа */
.modal .actions .btn-secondary{ order:1; }
.modal .actions .btn-primary{   order:2; }

/* контрастная "Отмена" */
.modal .actions .btn-secondary{
  background:#fff;
  color:#0b0f14 !important;
  border:1px solid #d0d5dd;
  box-shadow:0 1px 2px rgba(16,24,40,.05);
}
.modal .actions .btn-secondary:hover{ background:#f7f7f9; }
.modal .actions .btn-secondary:focus{ outline:2px solid #6ea8fe; outline-offset:2px; }
.modal .actions .btn-secondary:disabled{
  background:#fff; color:#6b7280 !important; opacity:.65;
}

/* футер модалки: увести кнопки вправо */
.modal .actions{
  display:flex;
  gap:12px;
  justify-content:flex-end;
  margin-top:16px;
}

/* контрастная "Отмена" */
.modal .actions .btn-secondary{
  background:#fff !important;
  color:#0b0f14 !important;
  border:1px solid #d1d5db !important;
  box-shadow:0 1px 2px rgba(16,24,40,.05);
}
.modal .actions .btn-secondary:hover{ background:#f8fafc !important; }
.modal .actions .btn-secondary:focus{ outline:2px solid #6ea8fe; outline-offset:2px; }

/* кнопки в футере модалки справа */
.modal .actions{ display:flex; gap:12px; justify-content:flex-end; }

/* "Отмена" — белая и читаемая */
.modal .actions .btn-secondary{
  background:#ffffff !important;
  color:#0b0f14 !important;
  border:1px solid #d1d5db !important;
  box-shadow:0 1px 2px rgba(16,24,40,.05);
}
.modal .actions .btn-secondary:hover{ background:#f8fafc !important; }
.modal .actions .btn-secondary:focus{ outline:2px solid #6ea8fe; outline-offset:2px; }

/* --- Регистрация: чёткая "Основная" кнопка --- */
.modal .actions .btn-primary{
  background:#111 !important;
  color:#fff !important;
  border-color:#111 !important;
}
.modal .actions .btn-primary:disabled{
  opacity:.7;               /* видно, но понятно, что disabled */
  filter:none;
}

/* маленькая подчёркнутая ссылка под полем пароля */
.form-row .help-link{
  margin-top:4px;
  font-size:.85rem;
  text-decoration:underline;
  color:#6b7280;
  background:transparent;
  border:0;
  cursor:pointer;
  width:max-content;
}
.form-row .help-link:hover{ color:#111; }

/* === Контрастная "Отмена" в модалке === */
.modal .actions .btn.btn-secondary{
  background:#fff !important;
  color:#0b0f14 !important;
  border:1px solid #d1d5db !important;
  box-shadow:0 1px 2px rgba(16,24,40,.05);
}
.modal .actions .btn.btn-secondary:hover{ background:#f8fafc !important; }
.modal .actions .btn.btn-secondary:focus{ outline:2px solid #6ea8fe; outline-offset:2px; }
.modal .actions .btn.btn-secondary:disabled{ opacity:.75 !important; }

/* На всякий случай: базовая .btn-secondary, если где-то вне модалки используется - убираем белую обводку */
.btn.btn-secondary{
  background: rgba(110, 168, 254, 0.1);
  color: var(--text);
  border: 1px solid rgba(110, 168, 254, 0.2);
}
.btn.btn-secondary:hover{ 
  background: rgba(110, 168, 254, 0.15);
  border-color: var(--brand);
}

/* Явный стиль для кнопки "Отмена" в модалке */
.modal .actions .btn.btn-cancel,
.modal .actions .btn.btn-secondary{
  background:#fff !important;
  color:#0b0f14 !important;
  border:1px solid #d1d5db !important;
  box-shadow:0 1px 2px rgba(16,24,40,.05);
}

/* ===== СТИЛИ ДЛЯ КАТАЛОГА ===== */
/* Кнопка "Войти" в каталоге должна выглядеть как в app.css */
body.app .auth-slot .btn-primary,
body.app .nav .auth-slot .btn-primary,
.app .nav .auth-slot .btn-primary {
  background: linear-gradient(135deg, #6ea8fe, #8bd3ff) !important;
  color: #0b0c10 !important;
  border-color: transparent !important;
  font-weight: 700 !important;
  padding: 11px 18px !important;
  border-radius: 12px !important;
  transition: all 0.25s ease !important;
  box-shadow: 0 4px 12px rgba(110, 168, 254, 0.3) !important;
}

body.app .auth-slot .btn-primary:hover,
body.app .nav .auth-slot .btn-primary:hover,
.app .nav .auth-slot .btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(110, 168, 254, 0.4) !important;
}

/* Кнопка "Выйти" в каталоге */
body.app .auth-slot .btn-secondary,
body.app .nav .auth-slot .btn-secondary,
.app .nav .auth-slot .btn-secondary {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e7e9ee !important;
  padding: 11px 18px !important;
  border-radius: 12px !important;
  transition: all 0.25s ease !important;
}

body.app .auth-slot .btn-secondary:hover,
body.app .nav .auth-slot .btn-secondary:hover,
.app .nav .auth-slot .btn-secondary:hover {
  background: rgba(110, 168, 254, 0.08) !important;
  border-color: #6ea8fe !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(110, 168, 254, 0.15) !important;
}

