/* =========================================
   PROFILE & AUTH PAGES — IMPROVED DESIGN
   ========================================= */

.profile-main {
  background: #0a0a0a;
  min-height: 100vh;
  position: relative;
  color: #ffffff;
}

/* Hero секция */
.hero-section {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
}

/* Фоновая сетка */
.hero-background-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: 50px 50px;
  background-image: linear-gradient(to right, rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  pointer-events: none;
  z-index: 0;
}

/* =========================================
   AUTH CONTAINER
   ========================================= */

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

/* Декоративные круги */
.auth-decoration {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

.decoration-circle {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
  filter: blur(40px);
  top: -100px;
  right: -100px;
  animation: float 8s ease-in-out infinite;
}

.decoration-circle-2 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.1) 0%, transparent 70%);
  top: auto;
  bottom: -80px;
  right: auto;
  left: -80px;
  animation-delay: -4s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-20px) scale(1.05);
  }
}

/* =========================================
   AUTH CARD
   ========================================= */

.auth-card {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 1.5rem;
  padding: 2.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 20px 50px -10px rgba(0, 0, 0, 0.5), 0 0 40px
    rgba(59, 130, 246, 0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

.auth-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 25px 60px -10px rgba(0, 0, 0, 0.6), 0 0 60px
    rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.25);
}

/* Иконка в карточке */
.auth-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(124, 58, 237, 0.2));
  border-radius: 1rem;
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.auth-title {
  color: white;
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: #9ca3af;
  font-size: 0.95rem;
  text-align: center;
  margin: 0 0 2rem;
}

/* =========================================
   FORM ELEMENTS
   ========================================= */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #d1d5db;
  padding-left: 0.25rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper svg {
  position: absolute;
  left: 1rem;
  color: #6b7280;
  transition: color 0.3s ease;
  pointer-events: none;
}

.input-wrapper:focus-within svg {
  color: #3b82f6;
}

.auth-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.875rem;
  color: white;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.auth-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.auth-input::placeholder {
  color: #6b7280;
}

/* Кнопка */
.btn-neon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  margin-top: 0.5rem;
  border-radius: 0.875rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-neon:hover {
  box-shadow: 0 6px 25px rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

.btn-neon:active {
  transform: translateY(0);
}

.btn-neon svg {
  transition: transform 0.3s ease;
}

.btn-neon:hover svg {
  transform: translateX(4px);
}

/* Разделитель */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  gap: 1rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
  color: #6b7280;
  font-size: 0.875rem;
}

/* Ссылка */
.auth-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  padding: 0.75rem;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
}

.auth-link span {
  color: #9ca3af;
}

.auth-link strong {
  color: #3b82f6;
  font-weight: 600;
}

.auth-link:hover {
  background: rgba(59, 130, 246, 0.05);
}

.auth-link:hover strong {
  color: #60a5fa;
}

/* Ошибки */
.error-list {
  margin-bottom: 1.5rem;
}

.error-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 0.75rem;
  color: #fca5a5;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.error-message:last-child {
  margin-bottom: 0;
}

.error-message svg {
  flex-shrink: 0;
  color: #ef4444;
}

/* =========================================
   PROFILE CARD
   ========================================= */

.profile-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.profile-card {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 1.5rem;
  padding: 2.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 20px 50px -10px rgba(0, 0, 0, 0.5), 0 0 40px
    rgba(59, 130, 246, 0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

/* Шапка профиля */
.profile-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.profile-role {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  padding: 0.375rem 0.875rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Информация профиля */
.profile-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 1rem;
  transition: all 0.3s ease;
}

.info-item:hover {
  background: rgba(59, 130, 246, 0.05);
  border-color: rgba(59, 130, 246, 0.1);
}

.info-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 0.75rem;
  color: #3b82f6;
  flex-shrink: 0;
}

.info-content {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.info-label {
  font-size: 0.8rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-size: 1rem;
  color: #e5e7eb;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Кнопки профиля */
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  font-size: 0.95rem;
  border-radius: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  transform: translateY(-2px);
}

.logout-form {
  margin: 0;
  width: 100%;
}

.logout-form button {
  width: 100%;
}

/* Ошибка */
.profile-card.error {
  text-align: center;
  border-color: rgba(239, 68, 68, 0.3);
}

.profile-card.error p {
  color: #fca5a5;
  margin: 0;
}

/* =========================================
   ANIMATIONS
   ========================================= */

.animate-in {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 576px) {
  .hero-section {
    padding: 1.5rem 1rem;
    min-height: calc(100vh - 60px);
  }

  .auth-card,
  .profile-card {
    padding: 2rem 1.5rem;
    border-radius: 1.25rem;
  }

  .auth-title {
    font-size: 1.5rem;
  }

  .auth-icon {
    width: 56px;
    height: 56px;
  }

  .auth-icon svg {
    width: 28px;
    height: 28px;
  }

  .profile-avatar {
    width: 70px;
    height: 70px;
    font-size: 1.75rem;
  }

  .profile-name {
    font-size: 1.25rem;
  }

  .info-item {
    padding: 0.875rem 1rem;
  }

  .info-icon {
    width: 40px;
    height: 40px;
  }

  .btn-neon,
  .btn-primary,
  .btn-secondary,
  .btn-danger {
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
  }

  /* Скрываем декоративные круги на маленьких экранах */
  .auth-decoration {
    display: none;
  }
}

@media (max-width: 375px) {
  .auth-card,
  .profile-card {
    padding: 1.5rem 1.25rem;
  }

  .auth-subtitle {
    font-size: 0.875rem;
  }

  .input-label {
    font-size: 0.8rem;
  }

  .auth-input {
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    font-size: 0.95rem;
  }
}

/* Поддержка safe-area для устройств с вырезами */
@supports (padding: max(0px)) {
  .hero-section {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
}
