/* ===== ОСНОВНЫЕ СТИЛИ ===== */
body {
  font-family: "Inter", sans-serif;
  background: linear-gradient(135deg, #0d1b2a, #1b263b, #415a77);
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  padding: 15px;
  box-sizing: border-box;
}

/* Анимированный фон */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(74, 107, 255, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 87, 87, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(77, 208, 225, 0.3) 0%, transparent 50%);
  animation: backgroundShift 15s ease-in-out infinite;
  z-index: 1;
}

@keyframes backgroundShift {
  0%, 100% { 
    transform: scale(1) rotate(0deg); 
    opacity: 0.8;
  }
  50% { 
    transform: scale(1.2) rotate(180deg); 
    opacity: 1;
  }
}

/* ===== КОНТЕЙНЕР АВТОРИЗАЦИИ ===== */
.auth-container {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 100%;
  max-width: 400px;
  min-width: 300px;
  padding: 25px 20px;
  border-radius: 16px;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-align: center;
  position: relative;
  z-index: 10;
  animation: containerAppear 0.6s ease-out;
  box-sizing: border-box;
}

@keyframes containerAppear {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== ШАПКА С ЛОГОТИПОМ ===== */
.auth-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.auth-logo {
  width: 70px;
  height: 70px;
  margin-bottom: 12px;
  border-radius: 16px;
  box-shadow: 
    0 8px 20px rgba(33, 150, 243, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.3rem;
  font-weight: bold;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: transparent;
  background: linear-gradient(135deg, #ffffff, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  margin: 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ===== ПЕРЕКЛЮЧАТЕЛЬ ФОРМ ===== */
.auth-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  gap: 8px;
}

.toggle-btn {
  flex: 1;
  padding: 12px 14px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s ease;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-sizing: border-box;
}

.toggle-btn.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  box-shadow: 
    0 4px 15px rgba(102, 126, 234, 0.4);
}

/* ===== ФОРМЫ ===== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  position: relative;
  margin-bottom: 4px;
}

.auth-form input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  box-sizing: border-box;
}

.auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.auth-form input:focus {
  border-color: rgba(102, 126, 234, 0.8);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* ===== КНОПКА ===== */
.auth-btn {
  margin-top: 12px;
  padding: 14px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
  box-sizing: border-box;
}

.auth-btn:hover {
  background: linear-gradient(135deg, #764ba2, #667eea);
  transform: translateY(-1px);
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.4);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===== ПРОСТЫЕ И ЗАМЕТНЫЕ УВЕДОМЛЕНИЯ ===== */
.popup-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 16px 24px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  z-index: 10000;
  text-align: center;
  min-width: 280px;
  max-width: 90vw;
  border-left: 4px solid;
  animation: messageSlide 0.3s ease-out forwards;
}

@keyframes messageSlide {
  0% {
    transform: translateX(-50%) translateY(-100px);
    opacity: 0;
  }
  100% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.popup-message.success {
  border-left-color: #2ecc71;
  color: #27ae60;
  background: rgba(46, 204, 113, 0.1);
}

.popup-message.error {
  border-left-color: #e74c3c;
  color: #c0392b;
  background: rgba(231, 76, 60, 0.1);
}

/* ===== ПОДСКАЗКИ ===== */
.input-hint {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(44, 62, 80, 0.95);
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.8rem;
  margin-top: 6px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  transform: translateY(-8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-sizing: border-box;
}

.input-hint.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(3px);
}

/* ===== СКРЫТИЕ ФОРМ ===== */
.hidden {
  display: none;
}

/* ===== УНИВЕРСАЛЬНАЯ АДАПТИВНОСТЬ ===== */

/* Мобильные устройства */
@media (max-width: 480px) {
  body {
    padding: 10px;
    align-items: flex-start;
    padding-top: 20px;
  }
  
  .auth-container {
    max-width: 100%;
    padding: 20px 15px;
    border-radius: 14px;
  }
  
  .auth-logo {
    width: 60px;
    height: 60px;
    font-size: 1.1rem;
  }
  
  .auth-title {
    font-size: 1.4rem;
  }
  
  .toggle-btn {
    padding: 10px 12px;
    font-size: 0.9rem;
  }
  
  .auth-form input {
    padding: 12px 14px;
    font-size: 0.9rem;
  }
  
  .auth-btn {
    padding: 12px;
    font-size: 0.95rem;
  }
  
  .popup-message {
    min-width: 250px;
    padding: 14px 20px;
    font-size: 0.9rem;
  }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
  .auth-container {
    padding: 18px 12px;
  }
  
  .auth-logo {
    width: 50px;
    height: 50px;
    font-size: 1rem;
  }
  
  .auth-title {
    font-size: 1.3rem;
  }
  
  .auth-form input {
    padding: 11px 13px;
  }
  
  .popup-message {
    min-width: 220px;
    padding: 12px 18px;
  }
}

/* Ландшафтная ориентация */
@media (max-height: 500px) and (orientation: landscape) {
  body {
    padding: 10px;
    align-items: flex-start;
  }
  
  .auth-container {
    padding: 15px;
    max-width: 90%;
  }
  
  .auth-header {
    margin-bottom: 15px;
  }
  
  .auth-logo {
    width: 45px;
    height: 45px;
    margin-bottom: 8px;
  }
  
  .auth-title {
    font-size: 1.2rem;
  }
  
  .auth-toggle {
    margin-bottom: 15px;
  }
  
  .auth-form {
    gap: 10px;
  }
  
  .auth-form input {
    padding: 10px 12px;
  }
}

/* Высокие экраны */
@media (min-height: 800px) {
  body {
    align-items: center;
  }
}