* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 300;
}
body {
  background: #0b1119;
  color: #eef2f6;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

/* Анимированный фон */
.bg-animation {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: float 15s infinite ease-in-out;
}
.bg-orb:nth-child(1) {
  width: 500px; height: 500px;
  background: #4884ff;
  top: -20%; left: -10%;
  animation-delay: 0s;
}
.bg-orb:nth-child(2) {
  width: 400px; height: 400px;
  background: #ff6b81;
  bottom: -15%; right: -10%;
  animation-delay: -5s;
}
.bg-orb:nth-child(3) {
  width: 350px; height: 350px;
  background: #3acf6b;
  top: 50%; left: 50%;
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -30px) scale(1.1); }
  50% { transform: translate(-20px, 40px) scale(0.9); }
  75% { transform: translate(-40px, -20px) scale(1.05); }
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes successPulse { 0% { box-shadow: 0 0 0 0 rgba(58,207,107,0.4); } 70% { box-shadow: 0 0 0 15px rgba(58,207,107,0); } 100% { box-shadow: 0 0 0 0 rgba(58,207,107,0); } }

/* Контейнер */
.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 500px;
  animation: scaleIn 0.5s ease;
}

/* Логотип */
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo a {
  font-size: 2.2rem;
  font-weight: 400;
  color: #fff;
  text-decoration: none;
  display: inline-block;
}
.auth-logo span {
  font-weight: 600;
  background: linear-gradient(135deg, #4884ff, #3acf6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-logo p {
  font-size: 0.85rem;
  opacity: 0.5;
  margin-top: 4px;
}

/* Карточка */
.auth-card {
  background: rgba(20, 28, 40, 0.9);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 32px;
  padding: 40px 36px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  transition: all 0.3s;
}

/* Табы */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  padding: 4px;
  margin-bottom: 32px;
}
.auth-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  border-radius: 13px;
  border: none;
  background: transparent;
  color: #9aabbf;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 400;
  transition: all 0.3s;
}
.auth-tab.active {
  background: #4884ff;
  color: #fff;
  font-weight: 500;
  box-shadow: 0 8px 20px rgba(72,132,255,0.3);
}
.auth-tab:hover:not(.active) {
  color: #fff;
  background: rgba(255,255,255,0.03);
}

/* Формы */
.auth-form {
  display: none;
  animation: slideUp 0.4s ease;
}
.auth-form.active {
  display: block;
}
.form-group {
  margin-bottom: 20px;
  position: relative;
}
.form-group label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 6px;
  font-weight: 400;
  opacity: 0.75;
  transition: all 0.3s;
}
.input-wrap {
  position: relative;
}
.input-wrap input {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 14px 18px;
  padding-right: 45px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s;
  font-family: inherit;
}
.input-wrap input:focus {
  border-color: #4884ff;
  box-shadow: 0 0 25px rgba(72,132,255,0.15);
  background: rgba(72,132,255,0.02);
}
.input-wrap input.error {
  border-color: #ff4757;
  animation: shake 0.4s ease;
  box-shadow: 0 0 15px rgba(255,71,87,0.2);
}
.input-wrap input.success {
  border-color: #3acf6b;
  box-shadow: 0 0 15px rgba(58,207,107,0.2);
}
.input-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #7f8fa0;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1rem;
  z-index: 2;
}
.input-icon:hover {
  color: #fff;
}
.input-icon.success-icon {
  color: #3acf6b;
}
.input-icon.error-icon {
  color: #ff4757;
}
.error-message {
  font-size: 0.7rem;
  color: #ff4757;
  margin-top: 6px;
  display: none;
  align-items: center;
  gap: 6px;
}
.error-message.show {
  display: flex;
}
.success-message {
  font-size: 0.7rem;
  color: #3acf6b;
  margin-top: 6px;
  display: none;
  align-items: center;
  gap: 6px;
}
.success-message.show {
  display: flex;
}
.password-strength {
  margin-top: 8px;
}
.strength-bar {
  height: 4px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
  margin-bottom: 4px;
}
.strength-fill {
  height: 100%;
  border-radius: 10px;
  transition: all 0.5s;
  width: 0%;
}
.strength-text {
  font-size: 0.65rem;
  opacity: 0.6;
  display: flex;
  justify-content: space-between;
}

/* Чекбоксы */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}
.checkbox-group input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
  margin-top: 2px;
}
.checkbox-group input[type="checkbox"]:checked {
  background: #4884ff;
  border-color: #4884ff;
}
.checkbox-group input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
}
.checkbox-group label {
  font-size: 0.8rem;
  opacity: 0.75;
  cursor: pointer;
  line-height: 1.4;
}
.checkbox-group label a {
  color: #8aa9ff;
  text-decoration: none;
}
.checkbox-group label a:hover {
  text-decoration: underline;
}

/* Кнопки */
.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, #4884ff, #3a6fd8);
  border: none;
  color: #fff;
  padding: 16px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 12px 30px rgba(72,132,255,0.3);
  position: relative;
  overflow: hidden;
}
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(72,132,255,0.5);
}
.btn-submit:active {
  transform: scale(0.98);
}
.btn-submit.loading {
  pointer-events: none;
  opacity: 0.7;
}
.btn-submit .spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}
.btn-submit.loading .spinner {
  display: inline-block;
}
.btn-submit.loading .btn-text {
  display: none;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Разделитель */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}
.divider-line {
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.divider-text {
  font-size: 0.75rem;
  opacity: 0.4;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Социальные кнопки */
.social-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.02);
  color: #eef2f6;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s;
  font-weight: 400;
}
.social-btn:hover {
  border-color: #4884ff;
  background: rgba(72,132,255,0.05);
  transform: translateY(-2px);
}
.social-btn i {
  font-size: 1.1rem;
}
.social-btn.google i { color: #ea4335; }
.social-btn.yandex i { color: #ffcc00; }
.social-btn.vk i { color: #0077ff; }

/* Ссылки */
.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.8rem;
  opacity: 0.6;
}
.auth-footer a {
  color: #8aa9ff;
  text-decoration: none;
  font-weight: 400;
}
.auth-footer a:hover {
  text-decoration: underline;
}

/* Шаги регистрации */
.steps-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}
.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: all 0.3s;
}
.step-dot.active {
  background: #4884ff;
  box-shadow: 0 0 10px #4884ff;
  width: 30px;
  border-radius: 20px;
}
.step-dot.completed {
  background: #3acf6b;
}

/* Роль */
.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.role-card {
  background: rgba(255,255,255,0.02);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}
.role-card:hover {
  border-color: rgba(72,132,255,0.3);
}
.role-card.selected {
  border-color: #4884ff;
  background: rgba(72,132,255,0.08);
  box-shadow: 0 0 25px rgba(72,132,255,0.15);
}
.role-card i {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}
.role-card.advertiser i { color: #4884ff; }
.role-card.client i { color: #ff6b81; }
.role-card h3 {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 4px;
}
.role-card p {
  font-size: 0.7rem;
  opacity: 0.5;
  line-height: 1.3;
}

/* Успешная регистрация */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}
.success-overlay.active {
  display: flex;
}
.success-card {
  background: #1a2533;
  border-radius: 32px;
  padding: 48px 36px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  border: 1px solid rgba(58,207,107,0.3);
  box-shadow: 0 30px 60px rgba(0,0,0,0.7);
  animation: scaleIn 0.4s ease;
}
.success-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(58,207,107,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: successPulse 2s infinite;
}
.success-icon-wrap i {
  font-size: 2.5rem;
  color: #3acf6b;
}

/* Модальное окно восстановления */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active {
  display: flex;
}
.modal {
  background: #1a2533;
  border-radius: 28px;
  padding: 36px;
  max-width: 450px;
  width: 90%;
  border: 1px solid rgba(72,132,255,0.3);
  box-shadow: 0 30px 60px rgba(0,0,0,0.7);
  animation: scaleIn 0.3s ease;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1a2533;
  color: #fff;
  padding: 14px 24px;
  border-radius: 60px;
  z-index: 999;
  border: 1px solid rgba(72,132,255,0.5);
  font-size: 0.9rem;
  transition: all 0.4s;
  white-space: nowrap;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
  .auth-card {
    padding: 28px 20px;
    border-radius: 24px;
  }
  .social-buttons {
    grid-template-columns: 1fr;
  }
  .role-selector {
    grid-template-columns: 1fr;
  }
  .auth-logo a {
    font-size: 1.8rem;
  }
}