/* ================= ROOT ================= */
:root {
  --bg-main: #050816;
  --bg-soft: rgba(255,255,255,0.04);
  --border-soft: rgba(255,255,255,0.08);

  --text-main: #ffffff;
  --text-dim: rgba(255,255,255,0.65);

  --accent-1: #7c5cff;
  --accent-2: #4bcfff;

  --radius: 18px;
}

/* ================= BACKGROUND ================= */

.onboarding-bg {
  position: fixed;
  inset: 0;
  z-index: 0;

  background:
    radial-gradient(circle at 15% 20%, rgba(124,92,255,0.25), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(75,207,255,0.18), transparent 40%),
    #050816;
}

/* ================= HEADER ================= */

.auth-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 20px 50px;
  z-index: 50;

  backdrop-filter: blur(20px);
  background: rgba(8, 12, 22, 0.6);

  border-bottom: 1px solid var(--border-soft);
}

.header-logo {
  width: 40px;
  opacity: 0.95;
}

.auth-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-header-left span {
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.3px;
}

.auth-header-right {
  display: flex;
  gap: 12px;
}

/* ================= BUTTONS ================= */

.tw-btn {
  padding: 10px 18px;
  border-radius: 12px;

  border: 1px solid var(--border-soft);
  background: var(--bg-soft);
  color: white;

  transition: all 0.25s ease;
}

.tw-btn:hover {
  background: rgba(255,255,255,0.08);
}

.tw-btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border: none;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow:
    0 10px 30px rgba(100,150,255,0.25),
    inset 0 0 12px rgba(255,255,255,0.15);
}

.tw-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 15px 40px rgba(100,150,255,0.35);
}

/* ================= SCROLL ================= */

.onboarding {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  z-index: 1;
  position: relative;
}

/* ================= SLIDES ================= */

.slide {
  height: 100vh;
  scroll-snap-align: start;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 140px 80px;
  position: relative;
}

/* ================= CONTENT ================= */

.slide-content {
  display: flex;
  justify-content: space-between;
  align-items: center;

  max-width: 1400px;
  width: 100%;
}

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

.text {
  max-width: 560px;
  z-index: 2;
}

.slide h2 {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.15;

  background: linear-gradient(90deg, #fff, #9fdcff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.slide p {
  font-size: 18px;
  color: var(--text-dim);
  margin-top: 18px;
  line-height: 1.7;
}

/* ================= IMAGE ================= */

.slide .image {
  position: relative;
}

.slide .image img {
  width: 820px;
  max-width: 45vw;

  opacity: 0.95;

  filter:
    drop-shadow(0 0 100px rgba(124,92,255,0.25))
    drop-shadow(0 0 60px rgba(75,207,255,0.2));

  transition: transform 1.5s ease;
}

/* ================= HERO ================= */

.slide-hero {
  text-align: center;
}

.hero-content {
  flex-direction: column;
  align-items: center;
}

.hero-logo {
  width: 320px;
  margin-bottom: 20px;
  opacity: 0.95;
}

.hero-title {
  font-size: 84px;
  font-weight: 900;
  line-height: 1.05;

  max-width: 900px;

  background: linear-gradient(90deg, #ffffff, #cfe6ff, #7df9ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 22px;
  color: var(--text-dim);
  margin-top: 20px;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 40px;
}

.hero-btn {
  padding: 16px 32px;
  font-size: 16px;
  border-radius: 14px;
}

.hero-btn-secondary {
  background: transparent;
  border: 1px solid var(--border-soft);
}

/* ================= ANIMATION ================= */

.slide-content {
  opacity: 0;
  transform: translateY(60px);
  transition: all 0.8s ease;
}

.slide.active .slide-content {
  opacity: 1;
  transform: translateY(0);
}

.slide.active img {
  transform: scale(1.05);
}

/* ================= MOBILE ================= */

@media (max-width: 900px) {

  .slide-content {
    flex-direction: column;
    text-align: center;
  }

  .slide h2 {
    font-size: 32px;
  }

  .hero-title {
    font-size: 42px;
  }

  .slide .image img {
    width: 260px;
    margin-top: 30px;
  }
}


/* ================= AUTH MODAL ================= */

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
}

/* затемнение + blur */
.auth-overlay {
  position: absolute;
  inset: 0;

  background: rgba(5, 8, 22, 0.6);
  backdrop-filter: blur(18px);

  opacity: 0;
  transition: 0.4s ease;
}

/* окно */
.auth-window {
  position: absolute;
  top: 50%;
  left: 50%;

  transform: translate(-50%, -40%) scale(0.9);

  width: 420px;
  max-width: 92%;

  background: rgba(15, 18, 35, 0.75);
  backdrop-filter: blur(30px);

  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;

  padding: 32px;

  opacity: 0;
  transition: all 0.35s ease;

  box-shadow:
    0 30px 80px rgba(0,0,0,0.6),
    0 0 40px rgba(124,92,255,0.2);
}

/* glow рамка */
.auth-window::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 22px;
  background: linear-gradient(135deg, #7c5cff, #4bcfff);
  opacity: 0.12;
  z-index: -1;
}

/* активное состояние */
.auth-modal.active {
  pointer-events: all;
}

.auth-modal.active .auth-overlay {
  opacity: 1;
}

.auth-modal.active .auth-window {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}


/* ================= TOAST ================= */

.toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;

    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 260px;
    max-width: 320px;

    padding: 14px 16px;
    border-radius: 14px;

    backdrop-filter: blur(12px);
    background: rgba(20, 20, 30, 0.65);

    border: 1px solid rgba(255,255,255,0.08);

    color: white;
    font-size: 14px;

    box-shadow:
        0 0 20px rgba(0,0,0,0.4),
        0 0 10px rgba(0,255,200,0.15);

    transform: translateY(20px);
    opacity: 0;

    animation: toastIn 0.25s ease forwards;
}

.toast.success {
    border-color: rgba(0,255,150,0.4);
    box-shadow:
        0 0 20px rgba(0,255,150,0.25),
        0 0 40px rgba(0,255,150,0.1);
}

.toast.error {
    border-color: rgba(255,80,80,0.4);
    box-shadow:
        0 0 20px rgba(255,80,80,0.25),
        0 0 40px rgba(255,80,80,0.1);
}

.toast.info {
    border-color: rgba(80,150,255,0.4);
}

/* анимация */
@keyframes toastIn {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastOut {
    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

.tw-hero-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.3px;

  background: linear-gradient(90deg, #ffffff, #cfe6ff, #7df9ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  text-shadow: 0 0 20px rgba(125, 249, 255, 0.15);
}

.tw-hero-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  margin-top: 6px;
  line-height: 1.5;
}

.tw-label {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 6px;
  display: block;
}

.tw-input {
  width: 100%;
  padding: 14px 16px;

  border-radius: 14px;

  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);

  color: white;
  font-size: 14px;

  outline: none;
  transition: all 0.25s ease;
}

.tw-input::placeholder {
  color: rgba(255,255,255,0.35);
}

.tw-input:focus {
  border-color: rgba(124,92,255,0.6);

  box-shadow:
    0 0 0 1px rgba(124,92,255,0.3),
    0 0 20px rgba(124,92,255,0.25);
}

.tw-link {
  font-weight: 600;
  text-decoration: none;

  background: linear-gradient(90deg, #7c5cff, #4bcfff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  position: relative;
}

.tw-link:hover {
  text-shadow: 0 0 10px rgba(124,92,255,0.6);
}

/* линия */
.tw-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;

  width: 100%;
  height: 1px;

  background: linear-gradient(90deg, #7c5cff, #4bcfff);

  transform: scaleX(0.4);
  transform-origin: left;
  opacity: 0.6;

  transition: all 0.25s ease;
}

/* hover */
.tw-link:hover {
  color: #cbbdff;
}

.tw-link:hover::after {
  transform: scaleX(1);
  opacity: 1;
  box-shadow: 0 0 8px rgba(124,92,255,0.6);
}

.tw-field {
  margin-bottom: 14px;
}

.tw-form-vertical {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-switch {
  text-align: center;
  margin-top: 14px;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.auth-switch-text {
  font-size: 14px;
  color: rgba(255,255,255,0.55);
}

/* =========================================================
   MOBILE FIX — FINAL (НЕ ЛОМАЕТ СЛАЙДЫ)
   ========================================================= */

@media (max-width: 900px) {

  /* ================= BASE ================= */

  body {
    overflow-x: hidden;
  }

  /* ================= HEADER ================= */

  .auth-header {
    padding: 12px 16px;
    height: 60px;
  }

  .auth-header-left span {
    display: none;
  }

  .header-logo {
    width: 32px;
  }

  .auth-header-right {
    gap: 8px;
  }

  .tw-btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* ================= SCROLL ================= */

  .onboarding {
    height: 100vh;
    overflow-y: auto;

    /* ключевой момент */
    scroll-snap-type: y proximity;
  }

  /* ================= SLIDES ================= */

  .slide {
    min-height: 100vh; /* вместо height:auto */
    height: auto;

    scroll-snap-align: start;

    padding: 90px 20px 60px;

    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ================= CONTENT ================= */

  .slide-content {
    flex-direction: column;
    align-items: center;
    text-align: center;

    gap: 24px;
    width: 100%;
  }

  .text {
    max-width: 100%;
  }

  /* ================= TYPO ================= */

  .slide h2 {
    font-size: 30px;
    line-height: 1.2;
  }

  .slide p {
    font-size: 15px;
    line-height: 1.6;
  }

  /* ================= IMAGE ================= */

  .slide .image {
    order: -1;
  }

  .slide .image img {
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
  }

  /* ================= HERO ================= */

  .hero-logo {
    width: 140px;
    margin-bottom: 10px;
  }

  .hero-title {
    font-size: 34px;
    line-height: 1.2;
    max-width: 100%;
  }

  .hero-sub {
    font-size: 15px;
    margin-top: 12px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px;
    margin-top: 24px;
  }

  .hero-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
  }

  .hero-btn-secondary {
    border: 1px solid rgba(255,255,255,0.12);
  }

  /* ================= ANIMATION FIX ================= */

  .slide-content {
    transform: none;
    opacity: 1;
  }

  .slide.active img {
    transform: none;
  }

}