/* ========================================
   Переменные и базовые настройки
   ======================================== */
:root {
  /* Цветовая схема - темная тема */
  --bg-primary: #0a0a0b;
  --bg-secondary: #111113;
  --bg-tertiary: #1a1a1d;
  --bg-hover: #232328;

  /* Цвета текста */
  --text-primary: #ffffff;
  --text-secondary: #a3a3a8;
  --text-muted: #535353;

  /* Акцентные цвета */
  --color-primary: #f33f00;
  --color-primary-hover: #f33f00;
  --color-primary-light: rgba(99, 102, 241, 0.1);

  /* Цвета статусов */
  --color-success: #10b981;
  --color-error: #ef4444;
  --color-warning: #f59e0b;

  /* Границы */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  /* Тени */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

  /* Анимации */
  --transition-base: all 0.2s ease;
  --transition-slow: all 0.3s ease;
}

/* ========================================
   Сброс и базовые стили
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(-20px, -20px) rotate(180deg);
  }
}

/* ========================================
   Контейнер авторизации
   ======================================== */
.auth-container {
  width: 100%;
  max-width: 440px;
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 40px;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
  background-repeat: no-repeat;
    background-position: bottom;
    background-size: cover;
    background-image: url(../assets/img/bg-main-5.jpg);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   Заголовок
   ======================================== */
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ========================================
   Форма
   ======================================== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  display: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text-primary);
  transition: var(--transition-base);
  outline: none;
}

input:-webkit-autofill {
    background-color: var(--bg-tertiary);
}
.form-input:-webkit-autofill, .form-input:-moz-autofill {
    background-color: var(--bg-tertiary);
}
.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:hover {
  background: var(--bg-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.form-input:focus {
    background: var(--bg-tertiary);
    border-color: #f33f00;
    box-shadow: 0 0 0 1px #f33f0080;
}

.form-input.error {
  border-color: var(--color-error);
  animation: shake 0.3s ease;
}

.form-input.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* ========================================
   Требования к паролю
   ======================================== */
.password-requirements {
  display: block;
  margin-top: 8px;
  animation: slideDown 0.2s ease;
}

.password-requirements ul {
  list-style: none;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 13px;
}

.password-requirements li {
  font-size: 11px;
  color: var(--text-muted);
  position: relative;
  padding-left: 12px;
  transition: var(--transition-base);
}

.password-requirements li::before {
  content: "○";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
}

.password-requirements li.valid {
  color: var(--color-success);
}

.password-requirements li.valid::before {
  content: "●";
  color: var(--color-success);
}
.password-field {
    position: relative;
}
        
        .password-toggle {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            cursor: pointer;
            padding: 4px;
            color: #b1b1b1;
            transition: color 0.2s ease;
            z-index: 2;
        }
        
        .password-toggle:hover {
            color: #f33f00;
        }
        
        .password-toggle:focus {
            outline: none;
            color: #f33f00;
        }
        
        .password-toggle svg {
            width: 20px;
            height: 20px;
        }
        
        /* Добавляем отступ справа для input, чтобы текст не перекрывался с кнопкой */
        .password-field .form-input {
            padding-right: 44px;
        }
@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 200px;
  }
}

/* ========================================
   Кнопки
   ======================================== */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition-base);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: #f33f00;
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-google {
  color: var(--text-primary);
  background: rgb(255 255 255 / 7%) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgb(255 255 255 / 15%) !important;
    box-shadow: 0px 0px 20px #0000002e;
}

.btn-google:hover {
  transform: translateY(-1px);
}

.btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shimmer 1s linear infinite;
}

@keyframes shimmer {
  to {
    left: 100%;
  }
}

/* ========================================
   Разделитель
   ======================================== */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 17px 0 8px;
  position: relative;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.auth-divider span {
  padding: 0 16px;
  font-size: 13px;
  color: #9f9f9f;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ========================================
   Футер
   ======================================== */
.auth-footer {
  margin-top: 32px;
  text-align: center;
}

.auth-footer p {
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-link {
  color: #f33f00;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-base);
  position: relative;
}

.auth-link:hover {
  color: #f33f00;
}

.auth-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.auth-link:hover::after {
  width: 100%;
}

/* ========================================
   Сообщения
   ======================================== */
.message {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  animation: slideInDown 0.3s ease;
  border: 1px solid;
}

.message p {
  margin: 0;
  line-height: 1.5;
}

.message p + p {
  margin-top: 4px;
}

.message-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
  border-color: rgba(239, 68, 68, 0.2);
}

.message-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.2);
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   Индикатор совпадения паролей
   ======================================== */
#passwordMatch {
  font-size: 13px;
  font-weight: 500;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ========================================
   Адаптивность
   ======================================== */
@media (max-width: 480px) {
  .auth-container {
    padding: 32px 24px;
    border-radius: 16px;
  }

  .auth-title {
    font-size: 24px;
  }

  .auth-subtitle {
    font-size: 14px;
  }

  .form-input {
        padding: 15px 20px;
        font-size: 14px;
  }

  .btn {
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* ========================================
   Поддержка темной темы системы
   ======================================== */
@media (prefers-color-scheme: light) {
  /* Стили остаются темными независимо от системных настроек */
  /* Это сознательный выбор для единообразия дизайна */
}

/* ========================================
   Улучшения доступности
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
