dialog {
  padding: 0;
  border: none;
  border-radius: 20px;
  background: transparent;
  overflow: visible;
  max-width: 90vw;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
}

.dialog1,
.dialog2 {
  width: 440px;
  max-width: 100%;
  background: linear-gradient(145deg, #ffffff 0%, #fefefe 100%);
  border-radius: 32px;
  box-shadow: 0 30px 50px -20px rgba(0, 0, 0, 0.3),
              0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 32px 0 32px;
  background: transparent;
}

.dialog-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(120deg, #1f2b48, #2d3b5e);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.close-btn {
  background: #f1f3f7;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 26px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5b6c86;
  transition: all 0.2s ease;
  line-height: 1;
}

.close-btn:hover {
  background: #e6e9f0;
  color: #1e2b3c;
  transform: rotate(90deg) scale(1.02);
}

.close-btn:focus-visible {
  outline: none;
}

.auth-form {
  padding: 0px 32px 0px 0px;
}

.input-group {
  margin: 24px 32px;
}

.input-group input {
  width: 340px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 500;
  background-color: #f9fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 28px;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
  font-family: inherit;
  color: #1a2634;
}

.input-group input:focus {
  border-color: #5c8bf5;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(92, 139, 245, 0.15);
}

.input-group input::placeholder {
  color: #a6b6cc;
  font-weight: 450;
}

/* Ссылка "Забыли пароль?" */
.forgot-password-wrap {
  text-align: right;
  padding: 0 32px;
  margin-top: -12px;
  margin-bottom: 16px;
}

.forgot-password-wrap a {
  font-size: 13px;
  color: #5c8bf5;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.forgot-password-wrap a:hover {
  color: #019A44;
  text-decoration: underline;
}

.submit-btn {
  width: 340px;
  background: linear-gradient(105deg, #017935, #014b21);
  border: none;
  padding: 14px 18px;
  border-radius: 40px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 32px;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px -6px rgba(26, 37, 62, 0.3);
  letter-spacing: 0.3px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(105deg, #014b21, #017935);
  box-shadow: 0 12px 24px -8px rgba(26, 37, 62, 0.4);
}

.submit-btn:active {
  transform: translateY(1px);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Кнопка "← Назад" */
.back-btn {
  display: block;
  background: none;
  border: none;
  color: #5b6c86;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0 32px 16px;
  transition: color 0.2s;
  font-family: inherit;
}

.back-btn:hover {
  color: #019A44;
}

/* Подсказка с контактом */
.code-hint {
  font-size: 14px;
  color: #566c86;
  margin: 20px 32px 0;
  line-height: 1.5;
}

.register-prompt {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 18px 32px 32px 32px;
  font-size: 14px;
  background: #fafcff;
  border-top: 1px solid #ecf1f7;
  color: #566c86;
}

.register-prompt a {
  color: #c90000;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.register-prompt a:hover {
  color: #019A44;
  text-decoration: underline;
}

/* Переключатели метода */
.auth-method-toggle,
.reg-method-toggle {
  display: flex;
  gap: 12px;
  padding: 0 0px;
  margin-top: 20px;
  margin-bottom: 4px;
}

.method-btn {
  flex: 1;
  padding: 12px 0;
  border: 1.5px solid transparent;
  border-radius: 28px;
  font-weight: 600;
  font-size: 15px;
  background-color: #f9fafc;
  color: #566c86;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  font-family: 'Inter', sans-serif;
}

.method-btn:hover {
  background-color: #ecf1f7;
  color: #2b3f66;
}

.method-btn.active {
  background: linear-gradient(105deg, #017935, #014b21);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px -6px rgba(26, 37, 62, 0.3);
}

/* Сообщение об ошибке входа */
.login-error {
  color: #e53e3e;
  font-size: 0.875rem;
  margin: 4px 32px 8px;
  text-align: center;
}

@keyframes fadeSlideIn {
  0%   { opacity: 0; transform: translateY(20px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}