/* =========================================
   GLOBAL / BODY
   ========================================= */

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* По умолчанию — ноутбуки и десктопы: скролла нет */
body.login-body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(circle at 0% 0%, #1d2a5a 0, #050816 55%, #020617 100%);
  color: #e5e7eb;

  overflow: hidden;     /* <— ДЕСЯТОК */
}

/* На планшетах и телефонах — включаем вертикальный скролл */
@media (max-width: 1024px) {
  body.login-body {
    overflow-x: hidden;
    overflow-y: auto;
  }
}

.login-form.is-hidden {
  display: none !important;
}

/* ===============================
   FIX: No horizontal scroll on mobile
   =============================== */
@media (max-width: 1024px) {
  html, body {
    overflow-x: hidden !important;
  }

  .login-shell,
  .login-panel,
  .login-media,
  .login-panel-inner {
    overflow-x: hidden !important;
  }

  /* защита от внутреннего смещения */
  * {
    box-sizing: border-box;
  }
}

/* =========================================
   SHELL LAYOUT: 2 COLUMNS (50/50)
   ========================================= */

.login-shell {
  position: relative;      /* ← нужно для градиента */
  height: 100vh;
  display: flex;
  flex-direction: row;
}

/* Левая половина — промо медиа (видео/картинка) */
.login-media {
  position: relative;
  flex: 0 0 25%;
  min-height: 100vh;
  overflow: hidden;
  z-index: 1;
}

/* Фон под медиа */
.login-media-bg {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Видео/картинка */
.login-media-bg video,
.login-media-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Лёгкое затемнение поверх видео */
.login-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 0 0, rgba(15,23,42,0.05), transparent 60%),
    linear-gradient(120deg, rgba(15,23,42,0.1), rgba(15,23,42,0));
  pointer-events: none;
}

/* video starts hidden */
.login-media-bg video {
  opacity: 0;
  transition: opacity .45s ease;
  will-change: opacity;
}

/* reveal when ready */
.login-media-bg.is-ready video {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .login-media-bg video { transition: none; }
}

/* ============================
   PLATFORM+ TEXT ON VIDEO
   ============================ */
.video-label {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;

  font-size: 0.85rem;          /* как у тебя в UI */
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: inherit;

  color: #9ca3af;              /* нужный тебе серый */

  opacity: 0.75;               /* мягче, спокойнее */
  text-shadow:
    0 0 6px rgba(0,0,0,0.35);  /* очень мягкая тень для читабельности */

  pointer-events: none;
}


/* =========================================
   RIGHT SIDE — LOGIN PANEL
   ========================================= */

.login-panel {
  position: relative;
  flex: 1 0 75%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 32px;
  background:
    radial-gradient(circle at 10% 10%, rgba(56,189,248,0.18), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(139,92,246,0.28), #020617 70%);
}

/* мягкий переход от правого блока к видео */
.login-panel::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 0;
  width: 48px;
  height: 100%;
  pointer-events: none;

  background: linear-gradient(
    to right,
    rgba(2, 6, 23, 0.6) 0%,
    rgba(2, 6, 23, 0.25) 60%,
    rgba(2, 6, 23, 0) 100%
  );
}

/* Внутренняя карточка формы (стекло) */
.login-panel-inner {
  width: 100%;
  max-width: 420px;

  background:
    radial-gradient(130% 180% at 0% 0%, rgba(37,99,235,0.14), transparent 60%),
    radial-gradient(120% 180% at 100% 100%, rgba(139,92,246,0.18), rgba(15,23,42,0.98));
  border-radius: 24px;
  border: 1px solid rgba(148,163,184,0.35);
  box-shadow:
    0 24px 55px rgba(0,0,0,0.8),
    inset 0 0 0.5px rgba(255,255,255,0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  padding: 28px 26px 26px;
}

/* =========================================
   HEADER TEXT (RIGHT SIDE)
   ========================================= */

.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
}

.login-eyebrow {
  margin: 0 0 4px;
  font-size: 1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.9);
}

.login-title {
  margin: 0;
  padding: 4px 0;            /* аккуратный воздух сверху/снизу */
  font-size: 1.35rem;
  font-weight: 800;
  color: #f9fafb;
  text-transform: uppercase; /* UPPERCASE */
  letter-spacing: 0.03em;    /* чтобы в верхнем регистре было приятно читать */
}

.login-subtitle {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(203,213,225,0.95);
}

.login-subtitle a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
}

.login-subtitle a:hover {
  text-decoration: underline;
}

/* =========================================
   FORM
   ========================================= */

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

/* GROUPS & LABELS */

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(226,232,240,0.96);
}

/* INPUTS — адаптивные */

.field-input {
  width: 100%;
  box-sizing: border-box;

  /* высота и паддинги под тач */
  padding: 10px 14px;
  min-height: 44px;

  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.78);
  color: #e5e7eb;

  /* адаптивный шрифт */
  font-size: clamp(0.9rem, 0.85rem + 0.2vw, 1rem);
  line-height: 1.3;
  outline: none;

  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 0 0 0 transparent;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    transform 0.08s ease;
}

.field-input::placeholder {
  color: rgba(148, 163, 184, 0.85);
}

.field-input::placeholder {
  font-size: 0.75rem;
}

/* фокус / hover одинаково выглядят и на десктопе, и на мобилке */
.field-input:focus,
.field-input:hover {
  border-color: rgba(56, 189, 248, 0.95);
  background: rgba(15, 23, 42, 0.96);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 1),
    0 0 0 1px rgba(56, 189, 248, 0.9),
    0 0 22px rgba(56, 189, 248, 0.3);
}
.field-hint {
  margin: 4px 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(148,163,184,0.85);
  text-align: center;          /* центрируем */
  width: 100%;                 /* чтобы занимало всю ширину группы */
}

/* ============================
   ERROR STATE FOR INPUT
   ============================ */


.field-input.input-error {
  border-color: rgba(239,68,68,0.9);
  background: rgba(185,28,28,0.12);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 1),
    0 0 0 1px rgba(239, 68, 68, 0.9),
    0 0 16px rgba(239, 68, 68, 0.35);
  animation: shakeInput 0.25s ease;
}

@keyframes shakeInput {
  0%   { transform: translateX(0); }
  30%  { transform: translateX(-4px); }
  60%  { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

/* ============================
   OPTIONAL: shake animation
   ============================ */

.field-group.has-error .field-input {
  animation: shakeInput 0.25s ease;
}

@keyframes shakeInput {
  0% { transform: translateX(0); }
  30% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

/* ============================
   OPTIONAL: error text
   ============================ */

.field-error {
  border-color: #ef4444 !important;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 1),
    0 0 0 1px rgba(239, 68, 68, 0.9),
    0 0 16px rgba(239, 68, 68, 0.35) !important;
}
.field-error-text {
  margin-top: -4px;
  font-size: 0.75rem;
  color: #fca5a5;
  display: none;
}

.field-group.has-error .field-error-text {
  display: block;
}


/* ROW: remember + forgot */

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  gap: 8px;
}

/* Checkbox */

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: rgba(209,213,219,0.96);
  cursor: pointer;
}

.checkbox input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #38bdf8;
}

/* Маленькая ссылка справа */

.link-sm {
  font-size: 0.86rem;
  color: #93c5fd;
  text-decoration: none;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;

  font-size: 0.86rem;
  font-weight: 600;
  color: #4ae3ff;              /* твой фирменный голубой */
  cursor: pointer;

  text-decoration: none;
  transition: color 0.18s ease, opacity 0.15s ease;
}

.link-button:hover {
  color: #7ff1ff;
  text-decoration: underline;
}

.link-button:active {
  opacity: 0.7;
}



/* =========================================
   PRIMARY BUTTON
   ========================================= */

.login-btn-primary {
  margin-top: 6px;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;

  color: #0b1120;
  background: linear-gradient(135deg, #38bdf8, #6366f1, #a855f7);
  background-size: 200% 200%;

  box-shadow:
    0 0 16px rgba(56,189,248,0.45),
    0 0 26px rgba(99,102,241,0.35),
    inset 0 0 0.5px rgba(255,255,255,0.16);

  transition:
    background-position 0.35s ease,
    transform 0.12s ease,
    box-shadow 0.2s ease;
}

.login-btn-primary:hover {
  background-position: 100% 0%;
  transform: translateY(-1px);
  box-shadow:
    0 0 20px rgba(56,189,248,0.6),
    0 0 32px rgba(129,140,248,0.5),
    inset 0 0 0.5px rgba(255,255,255,0.2);
}

.login-btn-primary:active {
  transform: translateY(1px);
  box-shadow:
    0 0 10px rgba(56,189,248,0.5),
    0 0 18px rgba(129,140,248,0.4),
    inset 0 0 0.5px rgba(255,255,255,0.22);
}

.login-register a {
  color: #4ae3ff;        /* твой фирменный голубой */
  font-weight: 600;
  text-decoration: none;
}

.login-register a:hover {
  text-decoration: underline;
  color: #7ff1ff;        /* подсветка при наведении */
}

/* =========================================
   TERMS TEXT
   ========================================= */

.login-terms {
  margin: 0px 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(148,163,184,0.95);
}

.login-terms a {
  color: #93c5fd;
  text-decoration: none;
  font-weight: 600;
}

.login-terms a:hover {
  text-decoration: underline;
}


/* =========================================
   OAUTH BLOCK (Google)
   ========================================= */

.login-oauth {
  margin-top: 4px;
  margin-bottom: 10px;
}

.btn-oauth {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.7);
  background: rgba(15,23,42,0.9);
  color: #e5e7eb;

  padding: 9px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;

  box-shadow:
    0 0 0 1px rgba(15,23,42,1),
    0 0 0 0 transparent;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    transform 0.08s ease;
}

.btn-oauth:hover {
  border-color: rgba(156,163,175,0.95);
  background: rgba(15,23,42,0.98);
  box-shadow:
    0 0 0 1px rgba(148,163,184,0.9),
    0 0 18px rgba(15,23,42,0.8);
  transform: translateY(-1px);
}

.btn-oauth:active {
  transform: translateY(1px);
}

/* Google-стиль внутри кнопки */

.btn-google-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-google-icon .g-letter {
  font-weight: 700;
  font-size: 0.95rem;
  background: conic-gradient(
    from 0deg,
    #4285f4 0deg 90deg,
    #ea4335 90deg 180deg,
    #fbbc05 180deg 270deg,
    #34a853 270deg 360deg
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn-google-label {
  white-space: nowrap;
}

/* Divider "or" */

.login-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(148,163,184,0.9);
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(
    to right,
    rgba(15,23,42,0),
    rgba(148,163,184,0.7),
    rgba(15,23,42,0)
  );
}


/* ============================
   GLOBAL PRELOADER WRAPPER
   ============================ */
#page-preloader {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;

  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease;
  z-index: 9999;
}

#page-preloader.preloader-visible {
  opacity: 1;
  pointer-events: all;
}

/* ============================
   PLATFORM+ LOADER — soft gradient ring
   ============================ */

.preloader-ring {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  justify-content: center;
  align-items: center;
  isolation: isolate;
}

/* ---- ВНЕШНИЙ РИНГ ---- */
.preloader-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 4px; /* толщина кольца */

  background: conic-gradient(
    from 0deg,
    #00B0FF,
    #8A2BE2,
    #00B0FF
  );

  -webkit-mask:
      radial-gradient(farthest-side, transparent calc(100% - 6px), black 0)
      content-box;
  mask:
      radial-gradient(farthest-side, transparent calc(100% - 6px), black 0)
      content-box;

  animation: spin-outer 1.1s linear infinite;
}

/* ---- ВНУТРЕННИЙ РИНГ ---- */
.preloader-ring::after {
  content: "";
  position: absolute;
  inset: 18px; /* уменьшенный размер */
  border-radius: 50%;
  padding: 4px;

  background: conic-gradient(
    from 0deg,
    #8A2BE2,
    #00B0FF,
    #8A2BE2
  );

  -webkit-mask:
      radial-gradient(farthest-side, transparent calc(100% - 6px), black 0)
      content-box;
  mask:
      radial-gradient(farthest-side, transparent calc(100% - 6px), black 0)
      content-box;

  animation:
    spin-inner 2.2s linear infinite;
}

/* ---------- Анимации ---------- */

@keyframes spin-outer {
  to { transform: rotate(360deg); }
}

@keyframes spin-inner {
  to { transform: rotate(-360deg); }
}

/* =========================================
   RESPONSIVE
   ========================================= */

/* Планшеты и мобилки */
@media (max-width: 1024px) {

  /* запрет горизонтального скролла */
  html, body {
    overflow-x: hidden;
  }

  .login-shell {
    flex-direction: column;        /* вместо двух колонок — одна */
    height: auto;
    min-height: 100vh;
  }

  .login-media {
    flex: 0 0 38vh;
    min-height: 38vh;
  }

  .login-panel {
    flex: 1 1 auto;
    min-height: auto;
    padding: 24px 16px 32px;       /* поменьше паддинги, чтобы не распирало */
  }

  .login-panel-inner {
    max-width: 420px;
    margin: 0 auto;
  }
}

/* Очень маленькие экраны — чуть поджать карточку */
@media (max-width: 640px) {
  .login-panel-inner {
    padding: 22px 18px 22px;
    border-radius: 20px;
  }

  .login-title {
    font-size: 1.4rem;
  }

  .field-input {
    font-size: 0.9rem;
  }

  .login-btn-primary {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .login-btn-primary,
  .field-input {
    transition: none !important;
  }
}