/* Современные стили для страниц авторизации */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0b0b0f 0%, #1a1a22 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Animated background */
.auth-page::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  top: -250px;
  right: -250px;
  animation: pulse 8s ease-in-out infinite;
}

.auth-page::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(108, 229, 177, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  bottom: -200px;
  left: -200px;
  animation: pulse 6s ease-in-out infinite reverse;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.auth-container {
  background: rgba(26, 26, 34, 0.8);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 48px 40px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 
              0 0 1px rgba(255, 255, 255, 0.1) inset;
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 1;
}

/* Логотип */
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #d4ff00 0%, #a3e000 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: bold;
  color: #0b0b0f;
  box-shadow: 0 10px 30px rgba(212, 255, 0, 0.3);
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  color: #f6f7fb;
  text-align: center;
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  font-size: 14px;
  color: #8b8d98;
  text-align: center;
  margin: 0 0 32px;
}

/* OAuth кнопки */
.auth-oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.btn-oauth {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #f6f7fb;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-oauth:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

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

.btn-oauth-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Разделитель */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: #8b8d98;
  font-size: 13px;
  font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* Поля ввода */
.auth-input-group {
  margin-bottom: 16px;
}

.auth-input-label {
  display: block;
  margin-bottom: 8px;
  color: #f6f7fb;
  font-size: 14px;
  font-weight: 600;
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #f6f7fb;
  font-size: 15px;
  transition: all 0.3s ease;
  outline: none;
}

.auth-input::placeholder {
  color: #8b8d98;
}

.auth-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-input:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Кнопки */
.auth-button-primary {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 24px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.auth-button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.auth-button-primary:active {
  transform: translateY(0);
}

.auth-button-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Ссылки */
.auth-links {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: #8b8d98;
}

.auth-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-link:hover {
  color: #d4ff00;
  text-decoration: underline;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #8b8d98;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
  transition: color 0.2s ease;
}

.auth-back-link:hover {
  color: #f6f7fb;
}

/* Сообщения об ошибках и успехе */
.auth-message {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-message.show {
  display: block;
}

.auth-message-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.auth-message-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

/* Ссылка "Забыли пароль?" */
.auth-forgot-password {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: #6b6d7a;
}

.auth-forgot-password a {
  color: #8b8d98;
  text-decoration: none;
}

.auth-forgot-password a:hover {
  color: #f6f7fb;
  text-decoration: underline;
}

/* Footer */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: #6b6d7a;
}

.auth-footer a {
  color: #8b8d98;
  text-decoration: none;
}

.auth-footer a:hover {
  color: #f6f7fb;
  text-decoration: underline;
}

/* Чекбокс согласия с условиями */
.auth-checkbox-group {
  margin-top: 20px;
  margin-bottom: 4px;
}

.auth-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.auth-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.auth-checkbox-custom {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.auth-checkbox-custom::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid #0b0b0f;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s ease;
}

.auth-checkbox:checked + .auth-checkbox-custom {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-color: #6366f1;
}

.auth-checkbox:checked + .auth-checkbox-custom::after {
  transform: rotate(45deg) scale(1);
}

.auth-checkbox:focus + .auth-checkbox-custom {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.auth-checkbox-label:hover .auth-checkbox-custom {
  border-color: rgba(255, 255, 255, 0.3);
}

.auth-checkbox-text {
  font-size: 13px;
  color: #8b8d98;
  line-height: 1.5;
}

.auth-checkbox-link {
  color: #a5b4fc;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-checkbox-link:hover {
  color: #c7d2fe;
  text-decoration: underline;
}

/* Стили для формы подтверждения email */
.code-input-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 32px 0;
}

.code-digit {
  width: 56px;
  height: 64px;
  text-align: center;
  font-size: 28px;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #f6f7fb;
  font-family: 'Courier New', monospace;
  transition: all 0.3s ease;
  outline: none;
  caret-color: #6366f1;
}

.code-digit:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.code-digit:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.code-digit:not(:placeholder-shown) {
  border-color: #6366f1;
}

.verify-timer {
  text-align: center;
  color: #8b8d98;
  font-size: 14px;
  margin: 16px 0 24px;
  font-weight: 500;
}

/* Вторичная кнопка для повторной отправки */
.auth-button-secondary {
  width: 100%;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.05);
  color: #f6f7fb;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 12px;
}

.auth-button-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.auth-button-secondary:active {
  transform: translateY(0);
}

.auth-button-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ============================================
   Яндекс OAuth кнопка и разделитель
   ============================================ */

/* Контейнер для кнопки Яндекс */
.yandex-auth-container {
  margin-top: 16px;
}

/* Обертка для SDK кнопки */
.yandex-auth-button-wrapper {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Сообщение загрузки */
.yandex-auth-loading {
  color: #8b8d98;
  font-size: 14px;
  padding: 12px;
  text-align: center;
}

/* Fallback кнопка Яндекс (если SDK не загрузился) */
.yandex-auth-button {
  width: 100%;
  padding: 12px 20px;
  background: #000000;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
}

.yandex-auth-button:hover {
  background: #1a1a1a;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.yandex-auth-button:active {
  transform: translateY(0);
}

/* Иконка Яндекса */
.yandex-auth-button-icon {
  width: 24px;
  height: 24px;
  background: #fc3f1d;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  color: #ffffff;
}

.yandex-auth-button-text {
  flex: 1;
  text-align: center;
}

/* Разделитель "или" с линиями */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: #8b8d98;
  font-size: 13px;
  font-weight: 500;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.auth-divider-text {
  color: #6b6d7a;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
}

/* Стили для iframe SDK Яндекса */
.yandex-auth-button-wrapper iframe {
  border: none !important;
  max-width: 100% !important;
}

/* ===========================================
   TWA Password Masking
   Маскировка пароля для TWA (Android app),
   чтобы избежать prompt "Сохранить пароль?" от Chrome.
   Используется вместо type="password" в TWA режиме.
   =========================================== */
.twa-password-mask {
  -webkit-text-security: disc;
  text-security: disc;
  font-family: inherit;
  letter-spacing: 0.06em;
}

/* Responsive */
@media (max-width: 480px) {
  .auth-container {
    padding: 32px 24px;
  }
  
  .auth-logo-icon {
    width: 64px;
    height: 64px;
    font-size: 32px;
  }
  
  .auth-title {
    font-size: 24px;
  }
  
  .code-input-container {
    gap: 8px;
  }
  
  .code-digit {
    width: 44px;
    height: 52px;
    font-size: 22px;
  }
}

