/**
 * Страница входа — новая палитра, фоновое фото в стиле минимализма,
 * неон, тактильные эффекты, загрузка с реалистичным грузовиком по прогрессу.
 */

/* ========== Фон: векторные графики (SVG) — чётко на любом разрешении ========== */
.auth-login-page {
  background: #0a0f1a !important;
  background-image: url("/static/assets/images/auth-bg-charts.svg") !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  position: relative;
  overflow: hidden;
}

/* Верхнее свечение и лёгкая сетка */
.auth-login-page::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 100% 60% at 50% -10%, rgba(14, 165, 233, 0.2) 0%, transparent 50%),
    linear-gradient(rgba(14, 165, 233, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 56px 56px, 56px 56px;
  pointer-events: none;
}

/* Минималистичный акцент: тонкая линия горизонта */
.auth-login-page::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(14, 165, 233, 0.4) 20%, rgba(14, 165, 233, 0.6) 50%, rgba(14, 165, 233, 0.4) 80%, transparent 100%);
  pointer-events: none;
}

/* ========== Контент поверх фона ========== */
.auth-login-page .auth-content {
  position: relative;
  z-index: 2;
}

/* ========== Карточка формы ========== */
.auth-login-page .card_c {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92) 0%, rgba(7, 11, 20, 0.96) 100%) !important;
  border: 1px solid rgba(14, 165, 233, 0.25) !important;
  border-radius: 16px !important;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(14, 165, 233, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  padding: 12px !important;
}

.auth-login-page .card_c .card-body {
  padding: 2rem 2.25rem !important;
}

/* ========== Логотип ========== */
.auth-login-page .card-body .img-fluid {
  filter: drop-shadow(0 0 20px rgba(14, 165, 233, 0.3));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.auth-login-page .card-body a:hover .img-fluid {
  transform: scale(1.03);
  filter: drop-shadow(0 0 24px rgba(14, 165, 233, 0.5));
}

/* ========== Неоновый заголовок ========== */
.auth-login-page .auth-login-title {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-shadow:
    0 0 10px rgba(14, 165, 233, 0.6),
    0 0 20px rgba(14, 165, 233, 0.4),
    0 0 40px rgba(14, 165, 233, 0.2);
  transition: text-shadow 0.3s ease, transform 0.25s ease, letter-spacing 0.25s ease;
  display: inline-block;
  cursor: default;
}

.auth-login-page .auth-login-title:hover {
  text-shadow:
    0 0 14px rgba(14, 165, 233, 0.8),
    0 0 28px rgba(14, 165, 233, 0.5),
    0 0 50px rgba(14, 165, 233, 0.3);
  transform: translateY(-2px);
  letter-spacing: 0.22em;
}

/* ========== Тактильный текст (ссылки, лейблы) ========== */
.auth-login-page .auth-login-tactile {
  color: rgba(255, 255, 255, 0.88);
  transition: color 0.2s ease, transform 0.2s ease, text-shadow 0.2s ease;
  display: inline-block;
  cursor: pointer;
}

.auth-login-page .auth-login-tactile:hover {
  color: #fff;
  transform: translateX(4px);
  text-shadow: 0 0 12px rgba(14, 165, 233, 0.5);
}

.auth-login-page .form-ch:hover .auth-login-tactile,
.auth-login-page a.form-ch:hover center {
  transform: translateX(4px);
  text-shadow: 0 0 12px rgba(14, 165, 233, 0.5);
}

/* ========== Поля ввода ========== */
.auth-login-page .input-group {
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.auth-login-page .input-group:focus-within {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.auth-login-page .input-group-text {
  background: rgba(14, 165, 233, 0.12) !important;
  border: none !important;
  color: rgba(14, 165, 233, 0.9) !important;
}

.auth-login-page .input-group .form-control {
  background: transparent !important;
  border: none !important;
  color: #fff !important;
  padding: 0.75rem 1rem;
}

.auth-login-page .input-group .form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* ========== Кнопка Вход ========== */
.auth-login-page .btn-primary.but-pad {
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.4);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  transition: transform 0.2s ease, box-shadow 0.25s ease, text-shadow 0.25s ease;
}

.auth-login-page .btn-primary.but-pad:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(14, 165, 233, 0.5);
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.4);
  color: #fff;
}

/* ========== Чекбокс "Запомнить меня" ========== */
.auth-login-page .form-check-input:checked {
  background-color: #0ea5e9 !important;
  border-color: #0ea5e9 !important;
}

.auth-login-page .form-check-label {
  color: rgba(255, 255, 255, 0.85) !important;
}

.auth-login-page .form-ch,
.auth-login-page .form-ch center {
  color: rgba(255, 255, 255, 0.8) !important;
  transition: color 0.2s ease, transform 0.2s ease;
}

.auth-login-page .form-ch:hover,
.auth-login-page .form-ch:hover center {
  color: #38bdf8 !important;
}

/* ========== Сообщение об ошибке ========== */
.auth-login-page .msg {
  color: #f87171;
  font-size: 0.9rem;
}

/* ========== Загрузчик: тот же векторный фон + машина проезжает ========== */
.auth-login-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #0a0f1a;
  background-image: url("/static/assets/images/auth-bg-charts.svg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.55s ease, visibility 0.55s ease;
  overflow: hidden;
}

.auth-login-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ========== Конструктор: расширенная сборка дашборда ========== */
.auth-login-loader-construct {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2rem 0;
}

.auth-login-loader-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 0 30px rgba(14, 165, 233, 0.4);
  opacity: 0;
  animation: auth-login-title-in 0.6s ease-out 0.1s forwards;
}

.auth-login-loader-subtitle {
  margin: 0 0 0.25rem 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(14, 165, 233, 0.8);
  opacity: 0;
  animation: auth-login-title-in 0.5s ease-out 0.25s forwards;
}

@keyframes auth-login-title-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-login-loader-blocks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  position: relative;
  z-index: 2;
}

.auth-login-loader-block {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92) 0%, rgba(7, 11, 20, 0.95) 100%);
  border: 1px solid rgba(14, 165, 233, 0.35);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 24px rgba(14, 165, 233, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: auth-login-block-assemble 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.auth-login-loader-block-1 { animation-delay: 0.08s; }
.auth-login-loader-block-2 { animation-delay: 0.14s; }
.auth-login-loader-block-3 { animation-delay: 0.2s; }
.auth-login-loader-block-4 { animation-delay: 0.26s; }
.auth-login-loader-block-5 { animation-delay: 0.32s; }
.auth-login-loader-block-6 { animation-delay: 0.38s; }
.auth-login-loader-block-7 { animation-delay: 0.44s; }
.auth-login-loader-block-8 { animation-delay: 0.5s; }
.auth-login-loader-block-9 { animation-delay: 0.56s; }
.auth-login-loader-block-10 { animation-delay: 0.62s; }
.auth-login-loader-block-11 { animation-delay: 0.68s; }
.auth-login-loader-block-12 { animation-delay: 0.74s; }

.auth-login-loader-from-top {
  transform: translateY(-100px) scale(0.5);
}

.auth-login-loader-from-bottom {
  transform: translateY(100px) scale(0.5);
}

.auth-login-loader-from-left {
  transform: translateX(-100px) scale(0.5);
}

.auth-login-loader-from-right {
  transform: translateX(100px) scale(0.5);
}

.auth-login-loader-from-center {
  transform: scale(0.3);
}

@keyframes auth-login-block-assemble {
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

.auth-login-loader-block-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #38bdf8;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.4));
}

.auth-login-loader-block-inner svg {
  width: 100%;
  height: 100%;
  opacity: 0;
  animation: auth-login-icon-in 0.35s ease-out forwards;
}

.auth-login-loader-block-1 .auth-login-loader-block-inner svg { animation-delay: 0.2s; }
.auth-login-loader-block-2 .auth-login-loader-block-inner svg { animation-delay: 0.26s; }
.auth-login-loader-block-3 .auth-login-loader-block-inner svg { animation-delay: 0.32s; }
.auth-login-loader-block-4 .auth-login-loader-block-inner svg { animation-delay: 0.38s; }
.auth-login-loader-block-5 .auth-login-loader-block-inner svg { animation-delay: 0.44s; }
.auth-login-loader-block-6 .auth-login-loader-block-inner svg { animation-delay: 0.5s; }
.auth-login-loader-block-7 .auth-login-loader-block-inner svg { animation-delay: 0.56s; }
.auth-login-loader-block-8 .auth-login-loader-block-inner svg { animation-delay: 0.62s; }
.auth-login-loader-block-9 .auth-login-loader-block-inner svg { animation-delay: 0.68s; }
.auth-login-loader-block-10 .auth-login-loader-block-inner svg { animation-delay: 0.74s; }
.auth-login-loader-block-11 .auth-login-loader-block-inner svg { animation-delay: 0.8s; }
.auth-login-loader-block-12 .auth-login-loader-block-inner svg { animation-delay: 0.86s; }

@keyframes auth-login-icon-in {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

.auth-login-loader-icon-dot {
  color: #f59e0b;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
}

.auth-login-loader-icon-dot svg {
  animation: auth-login-dot-pulse 1s ease-in-out 1s infinite;
}

@keyframes auth-login-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.1); }
}

/* Двойной импульс после сборки */
.auth-login-loader-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 20px;
  border: 2px solid rgba(14, 165, 233, 0.4);
  opacity: 0;
  pointer-events: none;
}

.auth-login-loader-pulse-1 {
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  animation: auth-login-pulse-ring 0.9s ease-out 0.95s forwards;
}

.auth-login-loader-pulse-2 {
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  animation: auth-login-pulse-ring 0.9s ease-out 1.05s forwards;
}

@keyframes auth-login-pulse-ring {
  0% {
    opacity: 1;
    transform: scale(0.5);
    border-color: rgba(14, 165, 233, 0.7);
  }
  100% {
    opacity: 0;
    transform: scale(1.35);
    border-color: rgba(14, 165, 233, 0);
  }
}

/* Прогресс-бар */
.auth-login-loader-progress {
  width: 200px;
  height: 4px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid rgba(14, 165, 233, 0.2);
  position: relative;
  z-index: 2;
}

.auth-login-loader-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0ea5e9, #22d3ee);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.5);
  animation: auth-login-progress-fill 1.2s ease-out 0.3s forwards;
}

@keyframes auth-login-progress-fill {
  to { width: 100%; }
}

.auth-login-loader-label {
  position: relative;
  z-index: 2;
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  animation: auth-login-label-in 0.4s ease-out 0.4s both;
}

@keyframes auth-login-label-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Появление контента только после завершения загрузки (класс .auth-content-visible в JS) */
.auth-login-page .auth-content {
  opacity: 0;
  transform: translateY(16px);
}

.auth-login-page.auth-content-visible .auth-content {
  animation: auth-login-content-in 0.6s ease-out forwards;
}

@keyframes auth-login-content-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
