.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1000px;
  width: 100%;
  min-height: 600px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.auth-card {
  padding: 48px;
  display: flex;
  flex-direction: column;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.auth-card h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.auth-form {
  flex: 1;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper i:first-child {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.input-wrapper input {
  flex: 1;
  background: transparent;
  padding: 14px 16px 14px 44px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
}

.input-wrapper .eye-icon {
  position: absolute;
  right: 16px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.input-wrapper .eye-icon:hover {
  color: var(--accent-primary);
}


.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.password-strength {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: all var(--transition-normal);
}

.strength-bar.weak { width: 33%; background: var(--accent-error); }
.strength-bar.medium { width: 66%; background: var(--accent-warning); }
.strength-bar.strong { width: 100%; background: var(--accent-success); }

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}

.checkbox-label input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.checkbox-label input:checked + .checkmark {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.checkbox-label input:checked + .checkmark::after {
  content: '✓';
  color: white;
  font-size: 12px;
}

.checkbox-label a {
  color: var(--accent-primary);
}

.forgot-link {
  font-size: 14px;
  color: var(--accent-primary);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.form-error {
  margin-top: 16px;
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--accent-error);
  border-radius: var(--radius-md);
  color: var(--accent-error);
  font-size: 14px;
  display: none;
}

.form-error.visible {
  display: block;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.auth-divider span {
  color: var(--text-muted);
  font-size: 13px;
}

.auth-alternatives {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--accent-primary);
  font-weight: 500;
}

.auth-visual {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.visual-content {
  text-align: center;
  padding: 40px;
  position: relative;
  z-index: 1;
}

.visual-content h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
}

.visual-content p {
  opacity: 0.9;
}

.centered-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 40px;
  filter: drop-shadow(0 0 24px rgba(255, 255, 255, 0.55));
}

.centered-logo .logo-icon {
  width: 180px;
  height: 180px;
  border-radius: 32px;
  object-fit: cover;
  box-shadow: 0 0 52px rgba(255, 255, 255, 0.78);
}

.floating-cards {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.float-card {
  position: absolute;
  z-index: 0;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  animation: float 4s ease-in-out infinite;
}

.float-card i {
  font-size: 20px;
}

.float-card span {
  font-weight: 500;
}

.card-1 {
  top: 10%;
  left: 4%;
  animation-delay: 0s;
}

.card-2 {
  top: 30%;
  right: 4%;
  animation-delay: 0.4s;
}

.card-3 {
  top: 50%;
  left: 6%;
  animation-delay: 0.8s;
}

/* Register page: отодвигаем карточки чуть дальше по горизонтали */
.register-page .card-1 {
  left: -6%;
}

.register-page .card-2 {
  right: -6%;
}

.register-page .card-3 {
  left: -2%;
}

.visual-content h2,
.visual-content p {
  position: relative;
  z-index: 2;
}

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

.card-1 {
  animation: float 4s ease-in-out infinite;
}

.card-2, .card-3 {
  animation: float 4s ease-in-out infinite;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--text-secondary);
  font-size: 20px;
}

.modal-content h3 {
  font-size: 22px;
  margin-bottom: 12px;
}

.modal-content > p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.qr-modal-content {
  max-width: 420px;
}

.qr-container {
  width: 220px;
  height: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.qr-container.rate-limit {
  background: #ffffff00;
  box-shadow: none;
}

/* Skeleton loading for QR code */
.qr-container.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-glass-light) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s ease-in-out infinite;
  border: 1px solid var(--border-color);
}

@keyframes skeletonLoading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.qr-container.skeleton::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(6, 182, 212, 0.05));
  border-radius: 22px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

.qr-loading, .qr-expired, .qr-success, .qr-waiting {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(11, 15, 26, 0.7); /* Тёмнее для контраста */
  color: #ffffff;
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  z-index: 100; /* Максимальный приоритет */
}

.qr-waiting span,
.qr-loading span,
.qr-success span,
.qr-expired span {
  color: #ffffff !important;
  font-weight: 800; /* Жирнее */
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
  font-size: 13px; /* Чуть компактнее */
  letter-spacing: 0.3px;
}

.qr-waiting i,
.qr-loading i,
.qr-success i,
.qr-expired i {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  z-index: 11;
}

.qr-loading i {
  font-size: 32px;
  color: var(--accent-primary);
}

.qr-expired {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 22px;
}

.qr-expired i {
  font-size: 40px;
  color: var(--text-primary);
}

.qr-expired span {
  font-size: 13px;
  color: var(--text-secondary);
}

.refresh-btn {
  width: auto;
  min-width: 90px;
  gap: 4px;
  padding: 5px 10px;
  font-size: 10px;
  border-radius: 6px;
  margin-top: 2px;
}

.refresh-btn i {
  font-size: 10px;
}

.qr-success {
  background: rgba(12, 16, 28, 0.55);
  text-align: center;
}

.qr-success i {
  font-size: 42px;
  color: var(--accent-success);
  animation: successBounce 0.6s ease-out;
}

@keyframes successBounce {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(360deg);
    opacity: 1;
  }
}

.qr-success.show {
  animation: successGlow 0.8s ease-out;
}

@keyframes successGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.qr-waiting i {
  font-size: 30px;
  color: var(--accent-primary);
}

.qr-code {
  padding: 12px;
  background: white;
  border-radius: var(--radius-md);
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.qr-code canvas {
  display: block;
}

.qr-code.blurred {
  filter: blur(8px) brightness(0.7);
  transform: scale(0.95);
  transition: all 0.3s ease;
}

.qr-container.skeleton .qr-code.blurred {
  filter: blur(12px) brightness(0.5);
  transform: scale(0.9);
  opacity: 0.8;
}

.qr-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.qr-timer i {
  color: var(--accent-primary);
}

.qr-timer.warning {
  color: var(--accent-warning);
}

.qr-timer.warning i {
  color: var(--accent-warning);
}

.qr-status {
  min-height: 24px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-primary);
  text-align: center;
}

.qr-status.scanned {
  color: var(--text-primary);
  font-weight: 500;
  text-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.qr-hint {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.qr-hint i {
  color: var(--accent-primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* Code inputs */
.code-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.code-input {
  width: 48px;
  height: 56px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.code-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.code-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.resend-btn {
  color: var(--accent-primary);
  font-size: 14px;
  margin-top: 16px;
}

.resend-btn:hover {
  text-decoration: underline;
}

#verifyError {
  margin-top: 12px;
}

/* Responsive */
@media (max-width: 768px) {
  .auth-container {
    grid-template-columns: 1fr;
  }
  
  .auth-visual {
    display: none;
  }
  
  .auth-card {
    padding: 32px 24px;
  }
}
